Advanced Data Structures and Algorithms Roadmap PDF by ScholarHat
Advanced Data Structures and Algorithms Roadmap PDF by ScholarHat
www.scholarhat.com
DATA STRUCTURES FOR BEGINNERS (LEVEL-2) ROADMAP
www.scholarhat.com
DATA STRUCTURES FOR BEGINNERS (LEVEL-2) ROADMAP Swipe
2 Trees
Here's a roadmap for Trees in DSA:
1. Generic Trees
Understand the structure of a generic tree i.e., Node,
Parent and Child.
Learn about traversal on generic trees (pre-order, post-
order, level-order).
2. Binary Trees
These are the types: Full Binary Tree, Complete Binary
Tree, Perfect Binary Tree.
Implement Tree Traversal (Inorder, Preorder,
Postorder).
3. Binary Search Tree (BST)
Understand operations (Insertion, Deletion) on BST.
Implement Inorder Successor / Predecessor.
4. AVL Trees
Learn about rotations (left rotation, right rotation, double
rotation) used to maintain balance.
Understand some self-balancing trees.
www.scholarhat.com
DATA STRUCTURES FOR BEGINNERS (LEVEL-2) ROADMAP Swipe
www.scholarhat.com
DATA STRUCTURES FOR BEGINNERS (LEVEL-2) ROADMAP Swipe
www.scholarhat.com
DATA STRUCTURES FOR BEGINNERS (LEVEL-2) ROADMAP Swipe
www.scholarhat.com
DATA STRUCTURES FOR BEGINNERS (LEVEL-2) ROADMAP Swipe
3 Advanced Trees
Below are some Advanced Trees in Data Structures:
1. Segment Trees
Range Queries: Find the sum, minimum, maximum,
or other aggregate value within a specific range of
indices in the original array.
Lazy Propagation: Learn about lazy propagation
techniques to optimize range update operations in
Segment Trees, especially when dealing with large
ranges or frequent updates.
2. K-dimensional Trees
K-D Trees: Learn about the recursive division
approach used to construct Kd-Trees.
3. Suffix Trees
Understand the properties of suffix trees, and their
applications in string processing.
Learn about the relationship between suffix trees
and suffix arrays.
www.scholarhat.com
DATA STRUCTURES FOR BEGINNERS (LEVEL-2) ROADMAP Swipe
www.scholarhat.com
DATA STRUCTURES FOR BEGINNERS (LEVEL-2) ROADMAP Swipe
www.scholarhat.com
DATA STRUCTURES FOR BEGINNERS (LEVEL-2) ROADMAP Swipe
www.scholarhat.com
DATA STRUCTURES FOR BEGINNERS (LEVEL-2) ROADMAP Swipe
5 Trie
A tree-like data structure used to store a dynamic set of
strings where each node represents a common prefix of a
group of strings.
Here’s a roadmap to master Trie:
1. Introduction to Trie:
Understand the structure of a Trie, which consists
of nodes representing characters, with edges linking
nodes to form words.
Learn about the properties of Tries (prefix
matching, space optimization, and efficient string
operations).
2. Trie Implementation:
Implement different Operations on Trie like
Insertion, Searching and Deletion
www.scholarhat.com
DATA STRUCTURES FOR BEGINNERS (LEVEL-2) ROADMAP Swipe
www.scholarhat.com
DATA STRUCTURES FOR BEGINNERS (LEVEL-2) ROADMAP Swipe
www.scholarhat.com
DATA STRUCTURES FOR BEGINNERS (LEVEL-2) ROADMAP Swipe
www.scholarhat.com
DATA STRUCTURES FOR BEGINNERS (LEVEL-2) ROADMAP Swipe
www.scholarhat.com
DATA STRUCTURES FOR BEGINNERS (LEVEL-2) ROADMAP Swipe
www.scholarhat.com
DATA STRUCTURES FOR BEGINNERS (LEVEL-2) ROADMAP Swipe
7 Graphs
Graphs are used to represent relationships between pairs of
objects. Graphs are composed of vertices (nodes) and
edges (connections between nodes).
Here's a roadmap for Graphs in DSA:
1. Introduction to Graphs
Understand graphs including vertices, edges etc.
2. Graph Representation
Adjacency Matrix: two-dimensional array (matrix)
where each cell indicates whether there is an edge
between two vertices.
Adjacency List: store the graph as an array of lists
where each list represents the neighbors of a vertex
3. Graph Traversal
Depth-First Search (DFS)
Breadth-First Search (BFS)
www.scholarhat.com
DATA STRUCTURES FOR BEGINNERS (LEVEL-2) ROADMAP Swipe
www.scholarhat.com
DATA STRUCTURES FOR BEGINNERS (LEVEL-2) ROADMAP Swipe
8 Greedy Algorithms
1. Dijkstra's Algorithm:
Learn about Dijkstra's algorithm for finding the
shortest path from a single source vertex to all other
vertices in a weighted graph with non-negative edge
weights.
2. Huffman Coding:
Learn about Huffman coding, uses a greedy
approach to construct an optimal prefix-free binary
tree for encoding symbols.
3. Spanning Tree Algorithms:
Prim's algorithm: starts with an arbitrary vertex,
iteratively adds the edge with the minimum weight
that connects the current tree to an unvisited vertex,
until all vertices are included.
Kruskal's algorithm: Another greedy algorithm that
sorts edges by weight in ascending order, and
iteratively adds edges to the tree as long as they
don't create a cycle.
www.scholarhat.com
DATA STRUCTURES FOR BEGINNERS (LEVEL-2) ROADMAP Swipe
9 Backtracking
Backtracking is a systematic method for generating all
possible solutions to a problem by traversing a search
space, making choices at each step and backtracking when
a solution cannot be found
Here's a roadmap for Backtracking in DSA:
1. Introduction to Backtracking:
Learn about the recursive nature of backtracking
algorithms and how to design them to efficiently
explore the solution space.
2. Typical Backtracking Problems:
N-Queens Problem:
Understand the classic N-Queens problem, where
the goal is to place N queens on an NxN
chessboard such that no two queens attack each
other.
Sudoku Solver:
Explore the Sudoku puzzle-solving problem, where
the goal is to fill a 9x9 grid with digits from 1 to 9
subject to certain constraints.
www.scholarhat.com
DATA STRUCTURES FOR BEGINNERS (LEVEL-2) ROADMAP Swipe
Questions to Master
Backtracking
Question 1: Permutations
Given an array nums of distinct integers, return all possible
permutations. You can return the answer in any order.
Question 3: N Queens
Given a string containing digits from 2-9 inclusive, return all
possible letter combinations that the number could
represent.
www.scholarhat.com
DATA STRUCTURES FOR BEGINNERS (LEVEL-2) ROADMAP Swipe
10 Dynamic Programming
A powerful optimization technique used to solve problems
by breaking them down into smaller subproblems and
storing the solutions to these subproblems to avoid
redundant calculations.
Here's a roadmap for Dynamic Programming in DSA:
1. Introduction to Dynamic Programming: Understand
the concepts of Dynamic Programming.
2. Understand common DP techniques:
Tabulation: uses an iterative approach to store
solutions in a table, avoiding recursion altogether.
Memoization: stores solutions to subproblems in a
dictionary or hash table, allowing for efficient
retrieval when needed during recursion.
www.scholarhat.com
DATA STRUCTURES FOR BEGINNERS (LEVEL-2) ROADMAP Swipe
Questions to Master
Dynamic Programming
Question 1: Russian Doll Envelopes
You are given a 2D array of integers envelopes where
envelopes[i] = [wi, hi] represents the width and the height of
an envelope.
One envelope can fit into another if and only if both the
width and height of one envelope are greater than the other
envelope's width and height.
Return the maximum number of envelopes you can Russian
doll (i.e., put one inside the other).
www.scholarhat.com
DATA STRUCTURES FOR BEGINNERS (LEVEL-2) ROADMAP Swipe
Questions to Master
Dynamic Programming
Question 3: Count Different Palindromic Subsequences
Given a string s, return the number of different non-empty
palindromic subsequences in s. Since the answer may be
very large, return it modulo 109 + 7.
A subsequence of a string is obtained by deleting zero or
more characters from the string.
A sequence is palindromic if it is equal to the sequence
reversed.
Two sequences a1, a2, ... and b1, b2, ... are different if
there is some i for which ai != bi.
www.scholarhat.com
DATA STRUCTURES FOR BEGINNERS (LEVEL-2) ROADMAP Swipe
Questions to Master
Dynamic Programming
Question 5: Palindrome Partitioning
Given a string s, partition s such that every substring of the
partition is a palindrome. Return the minimum cuts needed
for a palindrome partitioning of s.
www.scholarhat.com
DATA STRUCTURES FOR BEGINNERS (LEVEL-2) ROADMAP Swipe
Questions to Master
Dynamic Programming
Question 7: Longest Increasing Subsequence
Given an integer array nums, return the length of the
longest strictly increasing
subsequence.
www.scholarhat.com
DATA STRUCTURES FOR BEGINNERS (LEVEL-2) ROADMAP Swipe
Questions to Master
Dynamic Programming
Question 10: Longest Common Subsequence
Given two strings text1 and text2, return the length of their
longest common subsequence. If there is no common
subsequence, return 0.
A subsequence of a string is a new string generated from
the original string with some characters (can be none)
deleted without changing the relative order of the remaining
characters.
For example, "ace" is a subsequence of "abcde".
A common subsequence of two strings is a subsequence
that is common to both strings.
www.scholarhat.com
DATA STRUCTURES FOR BEGINNERS (LEVEL-2) ROADMAP Swipe
www.scholarhat.com
DATA STRUCTURES FOR BEGINNERS (LEVEL-2) ROADMAP Swipe
www.scholarhat.com
DATA STRUCTURES FOR BEGINNERS (LEVEL-2) ROADMAP Swipe
Congrats!
You are just one interview away!
www.scholarhat.com
DATA STRUCTURES FOR BEGINNERS (LEVEL-2) ROADMAP
WAS THIS
HELPFUL?
Share with your friend who needs it!