RZ 11/12 Extn.
Opp Hanuman Mandir, Pali factory
BIIT Classes road, Indra Park, Uttam Nagar, Delhi-110059
+91-7290803744, 8700652+91-7290803744,
8700652427427
Course: Data Structures and Algorithms
Module 1: Introduction to Time Complexity
Big O Notation: Understanding the asymptotic behavior of algorithms.
Example: Calculate the time complexity of a given algorithm in C/Java.
Best, Average, and Worst Case Analysis: Different scenarios in algorithm performance.
Common Complexities: O(1), O(log n), O(n), O(n log n), O(n²), etc.
Example: Compare sorting algorithms' complexities in C/Java.
Amortized Analysis: Average performance over a sequence of operations.
Module 2: Arrays
Definition and Properties: Basic structure and indexing.
Example: Declare and initialize arrays in C/Java.
Operations: Insertion, deletion, searching, and traversal.
Example: Implement insertion and deletion in arrays.
Multi-dimensional Arrays: 2D arrays and their applications.
Example: Matrix operations in C/Java.
Dynamic Arrays: Resizable arrays and their advantages.
Example: Implement a dynamic array class in Java.
Module 3: Strings
Basic Concepts: String definition and properties.
Example: String manipulation in C (character arrays) and Java (String class).
String Operations: Concatenation, substring, and comparison.
Example: Write functions to concatenate and compare strings.
String Matching Algorithms: Naive, KMP, Rabin-Karp.
Example: Implement KMP algorithm in C/Java.
Applications: Anagrams, palindromes, and pattern searching.
Example: Check for anagrams and palindromes in C/Java.
Module 4: Binary Search
Principles of Binary Search: Divide and conquer approach.
Example: Implement binary search recursively and iteratively in C/Java.
Implementation: Recursive and iterative methods.
Applications: Finding elements in sorted arrays, lower/upper bounds.
Example: Use binary search to find the first occurrence of an element.
Module 5: Two Pointers Technique
Concept: Using two pointers to solve problems.
Example: Implement two-pointer technique to solve pair sum problems in C/Java.
Applications: Problems like pair sum, merging two sorted arrays.
Example: Merge two sorted arrays using two pointers.
Sliding Window: Fixed and variable-sized window problems.
Example: Find the maximum sum of a subarray of size k.
Module 6: Recursion
Definition: Function calling itself.
Example: Implement recursive functions for factorial and Fibonacci in C/Java.
Base Case and Recursive Case: Fundamental components of recursion.
Problems: Factorial, Fibonacci, and backtracking problems.
Example: Solve the N-Queens problem using recursion.
Recursion vs Iteration: Pros and cons.
Module 7: Hashing
Concept: Mapping keys to values.
Example: Implement a simple hash table in C/Java.
Hash Functions: Creating efficient hash functions.
Collision Handling: Chaining, open addressing.
Example: Handle collisions using chaining.
Applications: Hash tables, sets, and maps.
Example: Use Java's HashMap and C's hash table for dictionary implementation.
Module 8: Sorting
Basic Sorting Algorithms: Bubble sort, selection sort, insertion sort.
Example: Implement these algorithms in C/Java.
Efficient Sorting Algorithms: Merge sort, quick sort, heap sort.
Example: Write merge sort and quick sort functions.
Specialized Sorting: Counting sort, radix sort, bucket sort.
Example: Implement counting sort in C/Java.
Stability and In-place Sorting: Understanding these properties.
Module 9: Bit Manipulation
Basics: Understanding binary numbers and bitwise operations.
Example: Perform bitwise operations in C/Java.
Bitwise Operators: AND, OR, XOR, NOT, shifts.
Applications: Counting bits, swapping numbers, and more.
Example: Write functions to count set bits and swap two numbers.
Module 10: Stacks
Definition and Properties: LIFO principle.
Example: Implement stack using arrays and linked lists in C/Java.
Operations: Push, pop, peek.
Implementation: Using arrays and linked lists.
Applications: Expression evaluation, balancing symbols.
Example: Check for balanced parentheses in an expression.
Module 11: Queues
Definition and Properties: FIFO principle.
Example: Implement queue using arrays and linked lists in C/Java.
Operations: Enqueue, dequeue, front, rear.
Types: Circular queue, priority queue, deque.
Example: Implement a circular queue.
Applications: Scheduling, buffering, breadth-first search.
Example: Implement BFS using a queue.
Module 12: Linked Lists
Basics: Nodes and pointers.
Example: Implement singly and doubly linked lists in C/Java.
Types: Singly, doubly, circular linked lists.
Operations: Insertion, deletion, searching, and traversal.
Example: Write functions for inserting and deleting nodes.
Applications: Implementing stacks, queues, and adjacency lists.
Example: Convert a binary tree to a linked list.
Module 13: Trees
Basic Concepts: Nodes, edges, root, leaves.
Example: Implement a binary tree and its traversals in C/Java.
Binary Trees: Types, properties, and traversals (preorder, inorder, postorder).
Binary Search Trees: Operations and properties.
Example: Implement BST operations.
Balanced Trees: AVL trees, red-black trees.
Example: Implement AVL tree rotations.
Tree Applications: Expression trees, Huffman coding.
Module 14: Tries
Definition: Prefix trees.
Example: Implement trie insert and search operations in C/Java.
Operations: Insertion, searching, deletion.
Applications: Autocomplete, spell checking, IP routing.
Module 15: Heaps
Concept: Binary heaps.
Example: Implement min-heap and max-heap in C/Java.
Types: Min-heap, max-heap.
Operations: Insertion, deletion, heapify.
Example: Write heap sort using a binary heap.
Applications: Priority queues, heap sort.
Module 16: Greedy Algorithms
Concept: Making the locally optimal choice.
Example: Implement activity selection problem in C/Java.
Examples: Activity selection, Huffman coding, Kruskal’s algorithm.
Example: Implement Kruskal’s algorithm for MST.
Proof of Correctness: Demonstrating why greedy works.
Module 17: Dynamic Programming
Principles: Overlapping subproblems, optimal substructure.
Example: Implement Fibonacci using memoization and tabulation in C/Java.
Techniques: Memoization, tabulation.
Problems: Knapsack, longest common subsequence, matrix chain multiplication.
Example: Solve the knapsack problem using dynamic programming.
Module 18: Graphs
Basic Concepts: Vertices, edges, adjacency matrix, adjacency list.
Example: Implement graph representation in C/Java.
Traversal Algorithms: Depth-first search (DFS), breadth-first search (BFS).
Example: Implement DFS and BFS.
Shortest Path Algorithms: Dijkstra’s, Bellman-Ford, Floyd-Warshall.
Example: Implement Dijkstra’s algorithm.
Minimum Spanning Tree: Kruskal’s and Prim’s algorithms.
Example: Implement Prim’s algorithm.
Advanced Topics: Topological sorting, strongly connected components.