Byte-Sized-Chunks: Stacks, Queues, Binary Trees, Heaps

A visual way to master basic data structures for strong fundamentals!
4.0 (3 ratings)
Instead of using a simple lifetime average, Udemy calculates a
course's star rating by considering a number of different factors
such as the number of ratings, the age of ratings, and the
likelihood of fraudulent ratings.
25 students enrolled
$19
$20
5% off
Take This Course
  • Lectures 23
  • Length 5.5 hours
  • Skill Level All Levels
  • Languages English
  • Includes Lifetime access
    30 day money back guarantee!
    Available on iOS and Android
    Certificate of Completion
Wishlisted Wishlist

How taking a course works

Discover

Find online courses made by experts from around the world.

Learn

Take your courses with you and learn anywhere, anytime.

Master

Learn and practice real-world skills and achieve your goals.

About This Course

Published 3/2016 English

Course Description

Note: This course is a subset of our much longer course 'From 0 to 1: Data Structures & Algorithms' so please don't sign up for both:-)

This is an animated, visual and spatial way to learn data structures and algorithms

  • Our brains process different types of information differently - evolutionarily we are wired to absorb information best when it is visual and spatial i.e. when we can close our eyes and see it
  • More than most other concepts, Data Structures and Algorithms are best learnt visually. These are incredibly easy to learn visually, very hard to understand most other ways
  • This course has been put together by a team with tons of everyday experience in thinking about these concepts and using them at work at Google, Microsoft and Flipkart

What's Covered:

  • Big-O notation and complexity
  • Stacks
  • Queues
  • Trees
  • Heaps

Talk to us!

Mail us about anything - anything! - and we will always reply :-)

What are the requirements?

  • Basic knowledge of programming is assumed, preferably in Java

What am I going to get from this course?

  • Design and implement software that use fundamental data structures
  • Visualise - really vividly imagine - the common data structures, and the algorithms applied to them
  • Understand the trade-offs, complexity and use-cases for different types of container data structures

What is the target audience?

  • Nope! Please don't enroll for this class if you have already enrolled for our 15-hour course 'From 0 to 1: Data Structures and Algorithms'
  • Yep! Computer Science and Engineering grads who are looking to really visualise data structures, and internalise how they work
  • Yep! Experienced software engineers who are looking to refresh important fundamental concepts

What you get with this course?

Not for you? No problem.
30 day money back guarantee.

Forever yours.
Lifetime access.

Learn on the go.
Desktop, iOS and Android.

Get rewarded.
Certificate of completion.

Curriculum

Section 1: Strong Fundamentals: Data Structures!
You, This Course, and Us!
Preview
01:09
15:40
The stack is a very simple and easy to understand data structure. However it lies underneath many complicated real world problems and is incredibly useful.
16:53
Let's build a stack for real using Java. It'll have all the operations we're interested in - push, pop, peek, size etc. It can hold any data type, it's a generic class.
11:21
Problems which use stacks as a part of their solutions are very common in programming interviews. Matching parenthesis to check for well formed expressions is a classic interview question - let's solve this using the stack we're already implemented.
08:51
Another interview question implemented. You have space available but your processing needs to be very fast indeed. How would you keep track of the minimum element of a stack as it changes?
14:11

The queue belongs to the same linear data structure family as the stack but it's behavior is very different. Queues are much more intuitive as there are plenty of real world examples where a queue is the fair and correct way of processing.

19:44
A common, fast but slightly tricky implementation of the queue is the array where the last element wraps around to the first. An interview favorite, let's see how to implement the circular queue.
17:30

We know the stack, and we know the queue. This problem brings them together. It's possible to mimic the behavior of a queue using 2 stacks in the underlying implementation. Let's write the most efficient code possible to make this work.

Section 2: Binary Trees
13:03

The binary tree is an incredibly useful hierarchical data structure. Many other, more complex data structures, use the binary tree as the foundation. Let's see what a binary tree looks like and learn some simple terminology associated with the tree.

18:43
Traversing a binary tree can be done in variety of ways. The breadth first traversal visits and processes nodes at every level before moving on to the next. Let's visualize breadth first traversal and see how it's implemented.
14:35

Depth first traversal can be of 3 types based on the order in which the node is processed relative to it's left and right sub-trees. Pre-order traversal processes the node before processing the left and then the right sub trees.

13:51

Depth first traversal can be of 3 types based on the order in which the node is processed relative to it's left and right sub-trees.

In-order traversal processes the left subtree, then the node itself and then it's right sub trees. Post-order traversal processes the node *after* it's left and right subtrees.

The algorithms are all remarkably similar and very easy once you use recursion.

Section 3: Binary Search Trees
09:49
A Binary Search Tree is a binary tree with specific constraints which make it very useful in certain operations. Learn what a BST is and how we can use it
17:00

Insertion and Lookup are operations which are very fast in a Binary Search Tree. See how they work and understand their performance and complexity.

Section 4: Binary Tree Problems
11:46

Find the minimum value in a binary search tree, find the maximum depth of a binary tree and mirror a binary tree. Learn to solve these problems recursively and see implementation details.

14:39
Count the number of structurally unique binary trees that can be built with N nodes, print the nodes within a certain range in a binary search tree and check whether a certain binary tree is a binary *search* tree. Learn to solve these problems and understand the implementation details.
14:49

Check if a path from root node to leaf node has a specified sum, print all paths from the root node to all leaf nodes and find the least common ancestor for two nodes in a binary tree. Learn to solve these problems and understand the implementation details.

Section 5: Heaps
17:15

Priority Queues allow us to make decisions about which task or job has the highest priority and has to be processed first. Common operations on a Priority Queue are insertion, accessing the highest priority element and removing the highest priority element.

The Binary Heap is the best implementation of the Priority Queue.

12:39

The Binary Heap is logically a Binary Tree with specific constraints. Constraints exist on the value of a node with respect to it's children and on the shape of the tree. The heap property and the shape property determine whether a Binary Tree is really a Heap.

07:38

Let's build a real heap in Java!

17:13

The Binary Heap may logically be a tree, however the most efficient way to implement it is using an array. Real pointers from parent to child and from child to parent become implicit relationships on the indices of the array.

19:32
How do we ensure that when we add an element or remove an element from an existing heap, that the heap property and shape property is maintained? This operation is called Heapify.
16:34
Once we understand heapify, adding and removing elements from a heap become very simple.

Students Who Viewed This Course Also Viewed

  • Loading
  • Loading
  • Loading

Instructor Biography

Loony Corn, A 4-person team;ex-Google; Stanford, IIM Ahmedabad, IIT

Loonycorn is us, Janani Ravi, Vitthal Srinivasan, Swetha Kolalapudi and Navdeep Singh. Between the four of us, we have studied at Stanford, IIM Ahmedabad, the IITs and have spent years (decades, actually) working in tech, in the Bay Area, New York, Singapore and Bangalore.

Janani: 7 years at Google (New York, Singapore); Studied at Stanford; also worked at Flipkart and Microsoft

Vitthal: Also Google (Singapore) and studied at Stanford; Flipkart, Credit Suisse and INSEAD too

Swetha: Early Flipkart employee, IIM Ahmedabad and IIT Madras alum

Navdeep: longtime Flipkart employee too, and IIT Guwahati alum

We think we might have hit upon a neat way of teaching complicated tech courses in a funny, practical, engaging way, which is why we are so excited to be here on Udemy!

We hope you will try our offerings, and think you'll like them :-)

Ready to start learning?
Take This Course