0% found this document useful (0 votes)
102 views11 pages

Bit Magic:, All Rights Reserved

This document provides an overview of various algorithms and data structures topics. It covers 18 main sections: Analysis of Algorithms, Mathematics, Bit Manipulation, Recursion, Arrays, Searching, Sorting, Matrix, Hashing, Strings, Linked Lists, Stacks, Queues, Deques, Trees, Binary Search Trees, Heaps, and Graphs. Each section explores fundamental concepts and common problems related to that topic.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
102 views11 pages

Bit Magic:, All Rights Reserved

This document provides an overview of various algorithms and data structures topics. It covers 18 main sections: Analysis of Algorithms, Mathematics, Bit Manipulation, Recursion, Arrays, Searching, Sorting, Matrix, Hashing, Strings, Linked Lists, Stacks, Queues, Deques, Trees, Binary Search Trees, Heaps, and Graphs. Each section explores fundamental concepts and common problems related to that topic.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 11

1.

Introduction

Analysis of Algorithms(Background)
Asymptotic Analysis
Order of Growth
Best, Average and Worst cases
Asymptotic Notation
Big O Notation
Omega Notation
Theta Notation
Analysis of Common loops
Analysis of multiple loops
Analysis of Recursion (Introduction)
Recursion Tree Method for Solving Recurrences
More Example Recurrences
Upper Bounds Using Recursion Tree Method
Space Complexity

2. Mathematics

Mathematics
Count Digits
Palindrome Numbers
Factorial of a Number
Trailing Zeros in Factorial
GCD or HCF of two Numbers
LCM of Two Numbers
Check for Prime
Prime Factors
All Divisors of a Number
Sieve of Eratosthenes
Computing Power
Iterative Power

3. Bit Magic
Bitwise Operators in CPP (Part 1)
Bitwise Operators in CPP (Part 2)
Check Kth bit is set or not
Count set bits
Power of Two
One Odd Occurring
Two Odd Occurring
Power Set using Bitwise

, All rights reserved


4. Recursion
Recursion Introduction
Applications of Recursion
Print N to 1 Using Recursion
Print 1 to N Using Recursion
Tail Recursion
Writing Base Cases in Recursion
Natural Number Sum using Recursion
Palindrome Check using Recursion
Sum of Digits Using Recursion
Rope Cutting Problem
Generate Subsets
Tower of Hanoi
Josephus Problem
Subset Sum Problem (Recursive Solution)
Printing all Permutations

5. Arrays
Introduction to Arrays
Array Types
Vector in C++
Operations on Arrays
Largest Element in an Array
Second Largest Element in Array
Check if an Array is Sorted
Reverse an Array
Remove duplicates from a sorted array
Move Zeros to End
Left Rotate an Array by One
Left Rotate an Array by D places
Leaders in an Array problem
Maximum Difference Problem with Order
Frequencies in a Sorted Array
Stock Buy and Sell Problem
Trapping Rain Water Problem
Maximum consecutive 1s
Maximum subarray sum
Longest Even Odd Subarray
Maximum Circular Sum Subarray
Majority Element
Minimum Consecutive Flips
Sliding Window Technique
Prefix Sum Technique
6. Searching

Binary Search (Iterative)


Binary Search (Recursive)
Analysis of Binary Search
Index of first Occurrence in Sorted
Index of last Occurrence in Sorted
Count Occurrences in Sorted
Count 1s in a Sorted Binary Array
Square root
Search in Infinite Sized Array
Search in Sorted Rotated Array
Find a Peak Element
Two Pointer Approach
Median of two sorted arrays
Repeating Elements Part (1)
Repeating Elements Part (2)
Allocate Minimum Pages (Naive Method)
Allocate Minimum Pages (Binary Search)

7. Sorting
Sort in C++ STL
Stability in Sorting Algorithm
Bubble Sort
Selection Sort
Insertion Sort
Merge sort introduction
Merge two sorted arrays
Merge function of Merge sort
Merge Sorting Algorithm
Merge Sort Analysis
Intersection of two sorted arrays
Union of two sorted arrays
Count inversions in Array
Naive partition
Lomuto Partition
Hoare partition
Quick Sort Introduction
QuickSort using Lomuto Partition
QuickSort using Hoare Partition
QuickSort analysis
Space Analysis of QuickSort
Choice of pivot and worst case of quick sort
Tail call elimination in QuickSort
Kth smallest element
Chocolate Distribution Problem
Sort an Array with two types of elements
Sort an array with three types of elements
Minimum Difference in an Array
Merge overlapping intervals
Meeting the maximum guests
Cycle Sort
Heap Sort
Counting Sort
Radix Sort
Bucket Sort
Overview of sorting algorithm

8. Matrix
Multidimensional array in CPP
Passing 2D arrays as arguments in CPP
Matrix in Snake Pattern
Matrix Boundary Traversal
Transpose of a Matrix
Rotate Matrix Anti-clockwise by 90
Spiral Traversal of Matrix
Search in Row-wise and Column-wise sorted matrix
Median of a Row Wise Sorted Matrix C++

9. Hashing
Introduction to Hashing
Hashing Application
Direct Address Table
Hashing Functions
Collision Handling
Chaining
Implementation of Chaining
Open Addressing
Double Hashing
Implementation of Open Addressing
Chaining vs Open Addressing
Unordered_set in C++ STL
Unordered_map in C++ STL
HashSet in Java
HashMap in Java
Count Distinct Elements
Frequencies of array elements
Intersection of two arrays
Union of two unsorted arrays
Pair with given sum in unsorted array
Subarray with zero sum
Subarray with given sum
Longest subarray with given sum
Longest Subarray with equal number of 0s and 1s
Longest common span with same sum in binary array
Longest Consecutive Subsequence
Count Distinct Elements In Every Window
More than n/k Occurences
More than n/k Occurences (O(nk) solution)

10. Strings
Introduction to String
Strings in C++
Palindrome Check
Check if a String is Subsequence of Other
Check for Anagram
Leftmost Repeating Character
Leftmost Non-repeating Element
Reverse words in a string
Overview of Pattern Searching
Naive Pattern Searching
Improved Naive Pattern Searching for Distinct
Rabin Karp Algorithm
KMP Algorithm
Check if Strings are Rotations
Anagram Search
Lexicographic Rank of a String
Longest Substring with Distinct Characters

11. Linked List


Problems With Array Data Structures
Introduction to Linked List
Simple Linked List Implementation in C++
Traversing a Linked List in C++
Recursive Traversal of Singly Linked List
Insert at Begin of Singly Linked List
Insert at the end of Singly Linked List
Delete First Node of Singly Linked List
Delete Last of Singly Linked List
Insert at given position in Singly Linked List
Search in a Linked List (Iterative and Recursive)
Doubly Linked List in C++
Singly Vs Doubly Linked List (Advantages & Disadvantages)
Insert at Begin of Doubly Linked List
Insert at End Doubly Linked List
Reverse a Doubly Linked List
Delete Head of a Doubly Linked List
Delete Last of a Doubly Linked List
Circular Linked List in C++
Circular Linked List (Advantages & Disadvantages)
Circular Linked List Traversal in C++
Insert at Begin of Circular Linked List
Insert at the end of Circular Linked List
Delete Head of Circular Linked List
Delete Kth of a Circular Linked List
Circular Doubly Linked List
Sorted Insert in a Singly Linked List
Middle of linked list
Nth Node from end of linked list
Reverse a linked list iterative
Recursive reverse a linked list (Part 1)
Recursive reverse a linked list (Part 2)
Remove duplicates from a sorted Singly Linked List
Reverse a linked list in groups of size k
Detect loop
Detect loop using floyd cycle detection
Detect and remove loop in linked list
Delete node with only pointer given to it
Segregate even odd nodes of linked list
Intersection of two linked list
Pairwise swap nodes of linked list
Clone a linked list using a random pointer
LRU Cache Design
Merge two sorted linked lists
Palindrome Linked List

12. Stack
Stack Data Structure
Array Implementation of Stack in C++
Linked List Implementation of Stack in C++
Stack Applications
Stack in C++ STL
Balanced Parenthesis
Two stacks in an array
K Stacks in an array
Stock span problem
Previous Greater Element
Next Greater Element
Largest Rectangular Area in a Histogram
Largest Rectangle with all 1's
Stack with getMin() in O(1)
Design a Stack with getMin() in O(1) Space
Infix, Prefix and Postfix Introduction
Infix to Postfix (Simple Solution)
Infix to Postfix (Efficient Solution)
Evaluation of Postfix
Infix to Prefix (Simple Solution)
Infix to Prefix (Efficient Solution)
Evaluation of Prefix

13. Queue
Queue Data Structure
Application of Queue Data structure
Implementation of Queue using Array
Implementation of Queue using Linked List
Queue in C++ STL
Implementing stack using queue
Reversing a Queue
Generate numbers with given digits

14. Deque

Deque Data Structure


Array Implementation of Deque
Deque in C++ STL
Design a Data Structure with Min and Max operations
Maximums of all subarrays of size k
First Circular Tour

15. Tree

Tree Data Structure


Application of Tree
Binary Tree
Tree Traversal
Implementation of Inorder Traversal
Implementation of Preorder Traversal
Implementation of Postorder Traversal
Height of Binary Tree
Print Nodes at K distance
Level Order Traversal
Level Order Traversal Line by Line
Size of Binary Tree
Maximum in Binary Tree
Print Left View of Binary Tree
Children Sum Property
Check for Balanced Binary Tree
Maximum Width of Binary Tree
Convert Binary Tree to Doubly Linked List
Construct Binary Tree from Inorder and Preorder
Tree Traversal in Spiral Form
Diameter of a Binary Tree
LCA of Binary Tree
Burn a Binary Tree from a Leaf
Count nodes in a Complete Binary Tree
Serialize and Deserialize a Binary Tree
Iterative Inorder Traversal
Iterative Preorder Traversal (Simple)
Iterative Preorder Traversal (Space Optimized)

16. Binary Search Tree

Binary Search Tree(Background)


Binary Search Tree(Introduction)
Search in BST (Introduction)
Search in BST C++
Insert in BST
Insert in BST C++
Deletion in BST
BST deletion in C++
Floor in BST
Floor in BST in CPP
Ceil in BST
Self Balancing BST
AVL Tree
Red Black Tree
Applications of BST
Set in C++ STL
Map in C++ STL
Ceiling on left side in an array
Find Kth Smallest in BST
Check for BST
Fix BST with Two Nodes Swapped
Pair Sum with given BST
Vertical Sum in a Binary Tree
Vertical Traversal of Binary Tree
Top View of Binary Tree
Bottom View of Binary Tree

17. Heap

Binary Heap Introduction


Binary Heap Implementation
Binary Heap Insert
Binary Heap (Heapify and Extract)
Binary Heap (Decrease Key, Delete and Build Heap)
Heap Sort
Priority Queue in C++
Sort K-Sorted Array
Buy Maximum Items with Given Sum
K Largest Elements
K Closest Elements
Merge K Sorted Arrays
Median of a Stream
18. Graph
Introduction to Graph
Graph Representation (Adjacency Matrix)
Graph Representation (Adjacency List)
Adjacency List implementation in CPP
Adjacency Matrix and List Comparison
Breadth First Search
Applications of BFS
Depth First Search
Applications of DFS
Shortest Path in an Unweighted Graph
Detect Cycle in Undirected Graph
Detect Cycle in a Directed Graph
Topological Sorting (Kahn's BFS Based Algortihm)
Topological Sorting (DFS Based Algorithm)
Shortest Path in DAG
Prim's Algorithm/Minimum Spanning Tree
Implementation of Prim's Algorithm C++
Dijkstra's Shortest Path Algorithm
Implementation of Dijkstra's Algorithm C++
Kosaraju's Algorithm
Bellman Ford Shortest Path Algorithm
Articulation Point
Bridges in Graph
Tarjans Algorithm
Kruskal's Algorithm

19. Greedy
Introduction to Greedy Algorithms
Activity Selection Problem
Activity Selection Solution in C++
Fractional Knapsack
Fractional Knapsack in C++
Job Sequencing Problem
Huffman Coding (introduction)
Huffman Algorithms
CPP Implementation of Huffman coding
Java Implementation of Huffman coding
, All rights reserved

20. Backtracking

Concepts of Backtracking
Rat In a Maze
N Queen Problem
Sudoku Problem
21. Dynamic Programming

Introduction to DP
Dynamic Programming Memoization
Dynamic Programming Tabulation
Longest Common Subsequence
Variation of LCS
Coin Change Count Combinations
Edit Distance Problem
Edit Distance Problem DP solution
Longest Increasing Subsequence Problem
Longest Increasing Subsequence O(nlogn)
Variation of LIS
Maximum Cuts
Minimum coins to make a value
Minimum Jumps to reach at end
0-1 knapsack problem
0-1 knapsack problem DP Solution
Optimal Strategy for a Game
Egg Dropping Puzzle
Count BSTs with n keys
Maximum sum with no two consecutive
Subset Sum Problem (Recursive Solution)
Subset Sum Problem (DP Solution)
Matrix Chain Multiplication
Matrix Chain Multiplication (DP Solution)
Palindrome Partitioning
Allocate Minimum Pages (Naive Method)
Allocate Minimum Pages (DP Solution)

22. Trie

Trie Data Structure (Introduction)


Trie (Representation, Search and Insert)
Trie Delete
Count Distinct Rows in a Binary Matrix

23. Segment and Binary Indexed Trees

Segment Tree (Introduction)


Constructing Segment Tree
Range Query on Segment Tree
Update Query on Segment Tree
Binary Indexed Tree (Introduction)
Binary Indexed Tree (An Example Problem)
Binary Indexed Tree (Prefix Sum)
Binary Indexed Tree (Prefix Sum Implemention)
Binary Indexed Tree (Update Operation)
24. Disjoint Set

Disjoint Set Introduction


Find and Union Operations on Disjoint Sets
Union by Rank
Path Compression
Kruskal's Algorithm
, All rights reserved

, All rights reserved

You might also like