Data structures and algorithms
Learn data structures through practical coding problems.
Build stronger problem-solving skills with tutorials on arrays, linked lists, stacks, trees, binary search trees, heaps, and priority queues.
Practice library
47
lessons
19
linear
28
non-linear
What is a data structure?
A data structure is a way of organizing data in the computer's memory so that it can be used effectively and efficiently. For learners, it helps to first separate data structures into two main types: linear data structures and non-linear data structures.
Linear data structures
- Array
- Linked List
- Stack
- Queue
Non-linear data structures
- Tree
- Graph List
Topic-wise learning
Choose a data structure
Start with linear structures, then move into trees and heaps when you are ready for hierarchical and priority-based problems.
Linear data structures
Learn structures where data is arranged one after another.
Non-linear data structures
Learn structures where data is connected through relationships.
Programs by hierarchy
Data structure programs for learners
Follow the same hierarchy used in the introduction. Start with linear data structures, then move into tree-based and heap-based non-linear topics.
Array
Array programs cover contiguous storage, indexes, traversal, searching, rotation, and pair-based problems.
Linked List
Linked list programs focus on node connections, traversal, insertion, middle-node lookup, and reversing a list.
Stack
Stack programs build LIFO problem-solving skills for nearest-element, histogram, span, and bracket-matching problems.
Tree
Tree is a non-linear data structure. Start with the basic tree introduction, then continue into Binary Tree and Binary Search Tree as nested topics.
Binary Tree
Binary tree programs cover traversal, search, height, size, leaf nodes, full and half nodes, diameter, and paths.
- 1Introduction to Binary Tree
- 2Binary tree traversals
- 3Reverse level order traversal
- 4Maximum in Binary tree
- 5Search a node in Binary tree
- 6Size of a binary tree
- 7Height of a binary tree
- 8Deepest node in a binary tree
- 9Number of leaf nodes in a binary tree
- 10Number of full nodes in a binary tree
- 11Number of half nodes in a binary tree
- 12Compare structure of two binary trees
- 13Compare structure and data of two binary trees
- 14Maximum level sum in a binary tree
- 15Diameter of a Binary tree
- 16All root-to-leaf paths of a Binary tree
Binary Search Tree
Binary search tree programs focus on ordered lookup, minimum-value search, and insertion.
Heap and Priority Queue
Heap programs cover min heap, max heap, heapify, heapsort, built-in heap usage, and priority queues.