Skip to content

rishav197/DSA

Repository files navigation

DSA

Binary Tree - BT

S.No. Problem Approach/Logic used Level Link Solution
1 Build Tree Recursively Easy view view
2 Count Leaf Nodes traverse the tree through any traversal technique and just check one condition if the node has no left subtree and no right subtree then increase the count Easy view view
3 Tree Traversals Easy view view
4 BT Representation Easy view view
5 Height of Binary Tree Easy view view
6 Diameter/width of a BT Medium view view
7 Balanced Tree or Not Easy view view
8 Tree Identical or Not Easy view view
9 Sum Tree or Not Medium view view
10 BT Level Order Traversal Medium view view
11 Sum of Longest Bloodline Medium view view

Binary Search Tree - BST

S.No. Problem Approach/Logic used Level Link Solution
1 Validate BST Easy view view
2 Two sum in BST Medium view view
3 Flatten BST to Sorted Linked List Medium view view
4 Normal BST to Balanced BST Medium view view
5 Merge two BSTs Medium view view
6 Largest BST in a BT Hard view view

Heaps

S.No. Problem Approach/Logic used Level Link Solution
1 Insertion and Deletion in Heap view view
2 Build Min Heap Easy view view
3 Heap Sort Medium view view
4 Merge two heaps Easy view view
5 Convert BST to Max Heap bst property(inorder of bst is sorted) and postorder has been used Medium view view
6 Kth Smallest using priority queue as maxheap Easy view view
7 Is BT Heap Heap follows two properties that's heap should be a CBT(complete BT) and should follow heap order property either max/min heap order Medium view view
8 kth largest sum subarray two approaches, one is using nested for loop and another one is using min heap Medium view view
9 Merge K Sorted Arrays two approaches Medium view view
10 Smallest Range from K sorted list 3 approaches Hard view view
11 Median in a Stream two approaches, one is bruteforce and another is using min and max heaps Hard view view

Graph DS

S.No. Problem Approach/Logic used Level Link Solution
1 Implementation of graph using Adjacency List view view
2 Implementation of graph using Adjacency Matrix view view
3 Creating and Printing Easy view view
4 BFS in Graph Medium view view
5 DFS in Graph Medium view view
6 Cycle Detection in Undirected Graphs using BFS BFS and a condition visited[neighbour]==true and neighbour!=parent[front] Medium view view
7 Cycle Detection in Undirected Graphs using DFS DFS and a condition visited[neighbour]==true and neighbour!=parent Medium view view
8 Cycle Detection in directed Graphs using DFS Medium view view
9 Topological Sort Medium view view
10 TopoSort using Kanh's algo Medium view view
11 Cycle Detection in directed graph using TopoSort Medium view view
12 Shortest Path in Undirected graph Medium view view
13 Shortest Path in DAG Medium view view

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages