We may earn an affiliate commission when you visit our partners.
Course image
Loony Corn

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

Read more

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
  • Graphs and Graph Algorithms
  • Linked lists
  • Sorting
  • Searching
Enroll now

What's inside

Learning objectives

  • Visualise - really vividly imagine - the common data structures, and the algorithms applied to them
  • Pick the correct tool for the job - correctly identify which data structure or algorithm makes sense in a particular situation
  • Calculate the time and space complexity of code - really understand the nuances of the performance aspects of code

Syllabus

What this course is about

A short intro to this course and what you can expect at the end of the course.

Data Structures And Algorithms - A Symbiotic Relationship
Read more

Data structures and Algorithms have a symbiotic relationship. The choice of data structure significantly influences the algorithms' performance and complexity and vice versa. Also learn about abstract data types and how they relate to data structures.

What is the performance of your code? How do you measure this? What is complexity and what is its relationship with performance?

The Big O notation is used to express complexity based on the size of the input specified for any algorithm. How is Big O expressed, how is it calculated and many examples to drive the concepts home!

The Big O notation becomes much clearer when you practice find the complexity of some sample pieces of code. Let's see how many of these you get right!

Linked lists are just one way to implement lists. Linked lists are less interesting in Java then in other programming languages such as C and C++ which require the developer to manage memory.

However lists are useful and a very core data structure so it makes sense to start off this class by understanding how we can set up a linked list in Java.

A few basic problems working with lists should give you a good idea of how to traverse and linked lists, add elements to a list and count the number of elements in a list.

The source code attached to this lecture has solutions for even more linked list based problems which are not covered in this lecture.

Linked lists and arrays solve the same kind of problems, holding a list or a collection. When would you use one over the other? Learn how you can make an informed choice.

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.

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.

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.

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?

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.

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.

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.

A sorting algorithm is not just defined by its complexity, there are a whole bunch of other characteristics which can be used to determine which sorting algorithm is the right one for a system. Let's understand what these characteristics are and what are the trade offs we might make.

The simplest and most naive sorting algorithm.

Closely allied with selection sort is bubble sort. Its an adaptive sort with the same time complexity as selection sort.

Insertion sort is an improvement over both bubble sort and selection sort. Let's see how exactly it works and why it's preferred in many cases.

Shell sort builds on top of insertion sort, it improves the complexity of it's running time by partitioning the list in a clever way.

This belongs to a class of algorithms which uses divide and conquer to break the problem set into smaller pieces. This also makes a time-space trade off to get a faster running time.

Quick sort is the sort of choice for developers of programming libraries. Let's see what makes it so attractive.

Binary search is a pretty nifty way to search through a sorted list in O(Log N) time. It's also an interview favorite so make sure you understand it well!

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.

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.

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.

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.

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

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

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.

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.

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.

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.

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.

Let's build a real heap in Java!

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.

Once we understand heapify, adding and removing elements from a heap become very simple.

Back to sorting. The Heap Sort uses a heap to transform an unsorted array into a sorted array. Phase I is converting the unsorted array into a heap.

Phase II actually outputs the final sorted array. It involves removing the elements from the heap and placing it in a sorted array. The cool thing is that all of this can be done in-place.

Let's practice heap problems! Use the heap property to find the largest element in a minimum heap and the K largest elements in a stream.

The graph is a data structure that is used to model a very large number of real world problems. It's also an programming interview favorite. The study of graphs and algorithms associated with graphs forms an entire field of study called graph theory.

Edges in a graph can be directed or undirected. A graph with directed edges forms a Directed Graph and those with undirected edges forms an Undirected Graph. These edges can be likened to one-way and two-way streets.

Different relationships can be modeled using either Directed or Undirected graphs. When a graph has no cycles it's called an acyclic graph. A graph with no cycles is basically a tree.

There are a number of different ways in which graphs can be implemented. However they all follow they same basic graph interface. The graph interface allows building up a graph by adding edges and traversing a graph by giving access to all adjacent vertices of any vertex.

An adjacency matrix is one way in which a graph can be represented. The graph vertices are rows and columns of the matrix and the cell value shows the relationship between the vertices of a graph.

The adjacency list and the adjacency set are alternate ways to represent a graph. Here the connection between the vertices is represented using either a linked list or a set.

Compare the adjacency matrix, adjacency list and the adjacency set in terms of space and time complexity of common operations

Common traversal methods of trees apply to graphs as well. There is an additional wrinkle with graphs, dealing with cycles and with unconnected graphs. Otherwise the algorithms are exactly the same as those we use to traverse trees.

Topological sort is an ordering of vertices in a graph where a vertex comes before every other vertex to which it has outgoing edges? A mouthful? This lecture will make things easy to follow. Topological sort is widely used in real world problems.

Here is the code in Java to implement topological sort.

Graphs with simple edges (directed or undirected) are unweighted graphs. The distance table is an important data structure used to find the shortest path between any two vertices on a graph. This is used in almost every shortest path algorithm.

Visualize the shortest path algorithm using the distance table, step by step.

Shortest path implementation in Java.

So far we only deal with unweighted graphs. Graphs whose edges have a weight associated are widely used to model real world problems (traffic, length of path etc).

A greedy algorithm is one which tries to find the local optimum by looking at what is the next best step at every iteration. It does not look at the overall picture. It's best used for optimization problems where the solution is very hard and we want an approximate answer.

Finding the shortest path in a weighted graph is a greedy algorithm.

Dijkstra's algorithm is a greedy algorithm to find the shortest path in a weighted graph.

The implementation of Dijkstra's algorithm in Java.

A weighted graph can have edge weights which are negative. Dealing with negative weights have some quirks which are dealt with using the Bellman Ford algorithm.

Visualize how the Bellman Ford works to find the shortest path in a graph with negative weighted edges.

If a graph has a negative cycle then it's impossible to find a shortest path as every round of the cycle makes the path shorter!

A minimal spanning tree is a tree which covers all the vertices of of the graph and has the lowest cost. Prim's algorithm is very similar to Dijkstra's shortest path algorithm with a few differences.

The minimal spanning tree is used when we want to connect all vertices at the lowest cost, it's not the shortest path from source to destination.

Let's see how we implement Prim's algorithm in Java.

Kruskal's algorithm is another greedy algorithm to find a minimal spanning tree.

Given a course list and pre-reqs for every course design a course schedule so pre-reqs are done before the courses.

Find the shortest path in a weighted graph where the number of edges also determine which path is shorter.

Traffic lights

Read about what's good
what should give you pause
and possible dealbreakers
Uses Java, which is widely used in enterprise environments and is a popular language for learning object-oriented programming and data structures
Covers stacks and queues, which are fundamental data structures often used in solving coding interview questions and in real-world applications
Employs an animated, visual, and spatial approach, which can be highly effective for understanding abstract concepts like data structures and algorithms
Explores Big-O notation and complexity analysis, which are essential for evaluating the efficiency of algorithms and optimizing code performance
Discusses graph algorithms, including shortest path algorithms, which are used in various applications such as network routing and social network analysis
Explains that linked lists are less interesting in Java than in other languages like C and C++, which may deter some learners interested in memory management

Save this course

Create your own learning path. Save this course to your list so you can find it easily later.
Save

Reviews summary

Visual introduction to data structures in java

According to learners, this course provides a strong foundational understanding of data structures and algorithms, particularly excelling through its visual explanations and animations. Students frequently praise the clear lectures and the way complex topics are broken down, making them accessible. While many find the pace suitable for building this foundation and appreciate the helpful code examples, some reviews suggest the course may be too basic for those with prior experience or could benefit from more practice problems and deeper dives into certain areas. The course is often cited as beneficial for technical interview preparation.
Code helps reinforce theory.
"The hands-on coding examples were crucial for understanding how the algorithms work in practice."
"I really appreciated the runnable Java code provided; it helped bridge the gap between theory and implementation."
"Seeing the code alongside the visual explanations made the concepts much clearer."
Provides a strong base in DSA basics.
"This course gave me a solid foundation in data structures and algorithms. It's a great starting point."
"Everything is explained clearly from the ground up, perfect for someone starting out in DSA."
"The way the fundamental concepts are introduced builds confidence before moving to more complex topics."
Concepts are made clear using visuals.
"The animations explaining data structures were incredibly helpful and made complex ideas stick."
"I learn best visually, and this course's approach to visualizing algorithms was a game-changer for me."
"The course does a fantastic job of visualizing how data structures work, which really solidified my understanding."
Pace inconsistent for some learners.
"Some early parts felt slow, but later sections covering graphs moved quite quickly for me."
"I struggled with the pace in the graphs section; maybe more practice problems or slower explanation needed there."
"For a '0 to 1' course, some parts assumed a bit too much prior coding familiarity."
Some wish for more advanced topics.
"While great for basics, I felt some topics could have gone into more depth or covered optimization more."
"Good introduction, but intermediate learners might find it a bit too simple in parts."
"Could use more in-depth coverage on complex topics or optimization techniques."

Activities

Be better prepared before your course. Deepen your understanding during and after it. Supplement your coursework and achieve mastery of the topics covered in From 0 to 1: Data Structures & Algorithms in Java with these activities:
Review Big-O Notation
Solidify your understanding of Big-O notation to better analyze the efficiency of data structures and algorithms covered in the course.
Browse courses on Big-O Notation
Show steps
  • Review the definition of Big-O notation and its purpose.
  • Practice determining the Big-O complexity of simple code snippets.
  • Work through examples of common data structure operations and their Big-O complexities.
Review 'Cracking the Coding Interview'
Supplement your learning with a widely-used resource for data structures and algorithms, focusing on interview preparation.
Show steps
  • Read relevant chapters on data structures and algorithms covered in the course.
  • Solve practice problems from the book to reinforce your understanding.
  • Compare your solutions with the book's solutions and analyze any differences.
LeetCode Easy Problems
Reinforce your understanding of data structures and algorithms by solving LeetCode problems.
Show steps
  • Select a set of LeetCode easy problems related to the topics covered in the course.
  • Attempt to solve each problem independently, focusing on efficiency and correctness.
  • Analyze the solutions and discuss alternative approaches.
Four other activities
Expand to see all activities and additional details
Show all seven activities
Create a Data Structure Visualization
Deepen your understanding by creating a visual representation of a complex data structure.
Show steps
  • Choose a data structure from the course, such as a graph or a tree.
  • Design a visual representation of the data structure, highlighting its key features and operations.
  • Create an animation or interactive visualization to demonstrate how the data structure works.
Implement a Simple Search Engine
Apply your knowledge of data structures and algorithms to build a practical application.
Show steps
  • Design the architecture of the search engine, including data structures for indexing and searching.
  • Implement the indexing component to process and store documents.
  • Implement the search component to retrieve relevant documents based on user queries.
  • Evaluate the performance of the search engine and optimize its efficiency.
Review 'Algorithms' by Robert Sedgewick and Kevin Wayne
Expand your knowledge with a comprehensive textbook on algorithms and data structures, providing in-depth explanations and Java code examples.
Show steps
  • Read chapters related to the course syllabus.
  • Study the Java code examples provided in the book.
  • Work through the exercises and programming assignments.
Tutor a Beginner in Data Structures
Solidify your understanding by explaining data structures and algorithms to someone new to the topic.
Show steps
  • Find a beginner who needs help with data structures and algorithms.
  • Prepare a lesson plan covering basic concepts and examples.
  • Explain the concepts clearly and answer any questions the beginner may have.
  • Provide practice problems and feedback to help the beginner improve.

Career center

Learners who complete From 0 to 1: Data Structures & Algorithms in Java will develop knowledge and skills that may be useful to these careers:
Algorithm Developer
An algorithm developer researches, designs, and implements algorithms for various applications. A course on data structures and algorithms is directly applicable to this role, as it provides the fundamental knowledge required to design efficient and effective algorithms. This course helps build skills in visualizing data structures, picking the correct tool for the job, and calculating the time and space complexity of code. The algorithm developer may find the sorting and searching section of the course to be valuable. Aspiring algorithm developers should take this course.
Software Engineer
A software engineer designs, develops, and tests software applications. This course helps build a foundation in data structures and algorithms, essential for writing efficient and scalable code. A software engineer needs to choose the right data structure for the job, whether it is choosing between linked lists and arrays, understanding how to use stacks, queues, or trees. The time and space complexity elements within this course may be useful to the software engineer to optimize the performance of code. Anyone who wants to become a software engineer should consider this course.
Backend Developer
A backend developer works on the server side of web applications, handling data storage, processing, and API development. This course helps build proficiency in data structures and algorithms, which are essential for optimizing backend performance and ensuring scalability. A backend developer may find the sections on linked lists, stacks, and queues to be valuable. The insights into searching and sorting algorithms are always useful. Aspiring backend developers should take this course.
Data Engineer
A data engineer builds and maintains the infrastructure for data storage and processing. Efficiency is key, so a data engineer needs to understand data structures and algorithms to optimize data pipelines and ensure scalability. This course helps build skills in Big O notation and complexity analysis, which are essential for evaluating the performance of different data processing techniques. The graph algorithms section of the course may be useful as a data engineer designs systems for large datasets. Consider enrolling in this course.
Mobile App Developer
A mobile app developer creates applications for smartphones and tablets. This course helps build a foundation in data structures and algorithms, which are essential for optimizing app performance and creating responsive user interfaces. A mobile app developer may find a deep dive into linked lists, stacks, and queues to be very helpful. Visualizing these concepts and seeing them in action is invaluable. Aspiring mobile app developers should enroll in this course.
Robotics Software Engineer
A robotics software engineer develops software for robots, including navigation, perception, and control systems. This course helps build a strong understanding of data structures and algorithms, which are essential for implementing efficient and robust robot control systems. A robotics software engineer may find the section on graph algorithms particularly relevant for path planning and navigation. The visual approach may be helpful. Consider this course if you are a robotics software engineer.
Machine Learning Engineer
A machine learning engineer develops and deploys machine learning models at scale. This course may be useful to the machine learning engineer, since they can enhance their understanding of the performance implications of different data structures and algorithms, particularly with regard to Big O notation. This can be useful when choosing data structures to process large amounts of training data. The machine learning engineer may find the section on binary trees beneficial. This course would be a great addition to the machine learning engineer's knowledge base.
Game Developer
A game developer creates video games for various platforms. This course helps build a deeper understanding of data structures such as trees and graphs which are frequently used in game development for representing game worlds, managing game objects, and implementing pathfinding algorithms. A game developer may find this course useful for optimizing game performance and creating compelling gameplay experiences. The course's perspective on visualizing data structures may be particularly helpful. Aspiring game developers should enroll in this course.
Data Scientist
A data scientist analyzes large datasets to extract meaningful insights and develop predictive models. This course may be useful for data scientists because it provides a solid understanding of fundamental data structures and algorithms. Expertise in Big O notation enables the data scientist to optimize their code as they work on large datasets and build machine learning models. Graph algorithms are relevant in social network analysis and recommendation systems. A data scientist should consider enrolling in this course.
Embedded Systems Engineer
An embedded systems engineer designs and develops software for embedded systems, such as those found in appliances and automobiles. Given the resource constraints typical of embedded systems, efficiency is paramount. This course helps build skills in analyzing the space and time complexity of algorithms, and selecting the most appropriate data structures for a given task, which are essential for optimizing code in embedded systems. The embedded systems engineer may find the section on heaps useful for implementing priority queues. Consider enrolling in this course.
Systems Architect
A systems architect designs and implements complex computer systems. This course may be useful to a systems architect through its examination of data structures and algorithms, which are fundamental concepts in computer science. A systems architect may leverage knowledge of stacks, queues, and trees to make informed decisions about system design and optimization. A solid grasp of Big O notation helps the systems architect evaluate the performance characteristics of different design choices. Aspiring systems architects will find this course relevant.
Database Administrator
A database administrator manages and maintains databases, ensuring data integrity and availability. Given that databases rely on efficiently storing and retrieving data, a solid understanding of data structures and algorithms is helpful to ensure optimal database performance. A database administrator benefits from understanding different algorithms for sorting and searching data and using appropriate data structures such as trees or heaps. A database administrator may find learning about binary search trees to be useful. Any aspiring database administrator should consider this course.
Firmware Engineer
A firmware engineer develops low level software that controls hardware devices. As these environments are often resource constrained, a firmware engineer needs to maximize efficiency. This course helps build the ability to analyze the time and space complexity of algorithms, and select the most appropriate data structures for a given task, which are essential for optimizing code in firmware. The course's exploration of embedded systems may be useful. A firmware engineer should consider this course.
Blockchain Developer
A blockchain developer builds decentralized applications using blockchain technology. This course may be useful because blockchain technology involves cryptography and complex data structures. A blockchain developer may learn about trees and graphs and optimize algorithms for data storage and retrieval. The Big O notation elements may be helpful in this field. A blockchain developer should consider enrolling in this course.
Quantitative Analyst
A quantitative analyst develops mathematical models for financial analysis and risk management. Although this role is heavily mathematical, a background in computer science is also needed. The quantitative analyst uses algorithms to process financial data, simulate market behavior, and optimize trading strategies. The focus on complexity analysis using Big O notation that this course provides may be useful for improving model performance. The quantitative analyst may find the sorting and searching section to be helpful. Consider enrolling in this course.

Reading list

We've selected two books that we think will supplement your learning. Use these to develop background knowledge, enrich your coursework, and gain a deeper understanding of the topics covered in From 0 to 1: Data Structures & Algorithms in Java.
Is specifically designed to help software engineers prepare for coding interviews. It covers a wide range of data structures and algorithms, with a focus on problem-solving techniques and common interview questions. It provides practical advice on how to approach coding problems and communicate your solutions effectively. This book is particularly useful for learners who are preparing for technical interviews at companies like Google, Microsoft, and Flipkart, as mentioned in the course description.
Provides a broad and in-depth coverage of algorithms and data structures, with a focus on practical applications. It includes Java implementations of many algorithms and emphasizes the importance of understanding performance characteristics. This book valuable resource for anyone who wants to deepen their understanding of algorithms and their real-world applications, and is often used as a textbook in universities.

Share

Help others find this course page by sharing it with your friends and followers:

Similar courses

Similar courses are unavailable at this time. Please try again later.
Our mission

OpenCourser helps millions of learners each year. People visit us to learn workspace skills, ace their exams, and nurture their curiosity.

Our extensive catalog contains over 50,000 courses and twice as many books. Browse by search, by topic, or even by career interests. We'll match you to the right resources quickly.

Find this site helpful? Tell a friend about us.

Affiliate disclosure

We're supported by our community of learners. When you purchase or subscribe to courses and programs or purchase books, we may earn a commission from our partners.

Your purchases help us maintain our catalog and keep our servers humming without ads.

Thank you for supporting OpenCourser.

© 2016 - 2025 OpenCourser