Other related course:
ITC 2017: https://sites.google.com/view/itc-ucp-2017
PF/OOP 2018: https://sites.google.com/view/pf-ucp-2018/
DM 2017: https://sites.google.com/view/ds-ucp-2017/home
DSA 2017: https://sites.google.com/view/dsa-ucp2017
Algo 2017: https://sites.google.com/view/algo-ucp-2017/home
Algo 2019: https://sites.google.com/view/algo-ucp-2019/home
Algo 2020: https://sites.google.com/view/algo-ucp-2020/home
Lecture 1 - The Story of Data Structures Begins
The Central Question of Data structures
We started with variable data structures
Their pros
Their limitation
Their applications
Sorting
Searching
Their issues
Growable Array with fixed addition
Its push_back function time complexity analysis
Vector Implementation
Its push_back function time complexity analysis
Arraylist implementation
Its push_back function time complexity analysis (exercise)
Lecture 2 - Stack Data Structures
FIXED SIZE STACK
Its ADT (multiple implementations)
Push/Pop/To multiple versions
Applications of STACK
Decimal to any base converter
Dynamic Stack
Using Vector implementation
NOTE - We shifted to online lectures (due to COVID-19 corona virus), and started recording lecture for both the sections, through MicrosoftTeams. In some of the playlist you will see two videos of the same lecture content(One for Section A and other for M). Please take one of the lecture.
Lecture 3 - Stack/Queues Data Structures
Discussion on Parenthesis balancing problem
Implementing THree Stacks Using One array
Maintaining Minimum and Maximum in Stack
Maintaining three stacks
Maintaining one stack of augmented entry
Tower of Hanoi
Sorting the Stack
Circular Queue
Queue Using Two Stacks
Steueue
Lecture 4 - Time Complexity
Logarithmic function
Big Theta
Lecture 5 - Time Complexity II (Big O, Big Omega and Theta)
Which algorithm is faster
Logarithmic function
Lecture 5b(Tutorial) - We did saveral examples and calculated Time Complexity (Big O, Big Omega and Theta)
Lecture 6 - Expression Evaluator (Infix to Postfix Notation)
N^2 Algorithm
Lecture 7 - Recursion Begins
Recursive Definition
Sum(N) = N+Sum(N-1); ==> Converts into Recursive function
Sum(1) = 1 ==> Base case....
2. Factorial(N) = N*N-1*N-2*...*3*2*1
Recursive Definition
N! = N . (N-1)!
0! = 1
3. int GCD(int Dividend, int Divisor)
Recursive Definition
GCD(A, B) = B if (A%B==0)
GCD(A, B) = GCD(B, A%B)
Recursive Definition
SearchLAST(A[], Size, T) = -1 Size = 0
SearchLAST(A[], Size, T) = Size-1 if A[Size-1]==T
SearchLAST(A[], Size, T) = Search(A[], Size-1, T) if A[Size-1]!=T
Recursive Definition
Lecture 8 - Recursion II (Advanced Recursion)
Recursive Definition
SlowPower(X, Y) = X * SlowPower(X, Y-1) Y!=0
SlowPower(X, Y) = 1 Y=0
The Problem of Stack Overflow
3. FAST POWER
Recursive Definition
FASTPower(X, Y) = 1 Y=0
FASTPower(X, Y) = FASTPower(X, Y/2)^2 Y%2==0
FASTPower(X, Y) = X * FASTPower(X, Y/2)^2 Y%2!=0
Recursive Definition
Using Doubling Technique
4. FAST Division
Recursive Definition
Using Doubling Technique
Recursive Definition
Recursive Formulation
Problem with repetition of the same recursive problem
Memoization
Bottom Up Approach and Dynamic Programming
Notes on Recursion from GeeksforGeeks
Lecture 9 - Revision Session over previous homeworks
1. Queue
Linear Queue
Problem of dequeue function
Circular Queue
All functions implementation
enqueue, dequeue, top, isFull, isEmpty
Notes-Discussion Written in class
Lecture # 9 -Video Lecture (Section A) [Not Yet Uploaded]
Lecture 10 - The Journey of Data Structures So far... Building a Train through connections
Journey of Data Structures so far
Variables (pros and cons)
Why we have to leave Variables???
Static Arrays (pros and cons)
Why we have to leave static arrays???
Dynamic Grow-able Heap Array(pros and cons)
Why have to leave Grow-able Heap Array???
Vectors/Arraylist (pros)
Its analysis
Its applications
Stack/Queues Grow-able and static
Why Vectors have issues also???
Using Boggies/Dabbas analogy
Lecture 10b - Linked List Data Structures
Making Linked List Data Structures
InsertAtbeginning
Insert At Head
InsertAtEnd
O(N) Implementation
Using Tail Find and then insert after Tail and update the Tail
O(1) Implementation using Tail pointer
Lecture 11 - Linked List Data Structures
Doubly Linked-List
Lecture 12 - Linked List Data Structures (Iterators and STL list data structure)
Kth Last Element
- forward
- reverse
- insert and its saveral variants
- insert(List.begin(), value)
- insert(List.end(), value)
- insert(iterator, value)
Lecture 13 - Sorting Algorithms (Bubble Sort and mergeSort) using Iterators and STL list data structure Vectors and List Data Structures
Using Vectors
Using list Data Structures
Using Vectors
Using list
Using Vectors
Using list
Lecture 14 - Introduction to Graphs Data Structures
Undirected Graphs
Directed Graphs
Adjacency Matrix
Adjacency List
Lecture 15 - Graphs Traversals
Adjacency Matrix
Adjacency List
Its applications
Finding the shortest path in a graph
Lecture 16 - Graphs Traversals (DFS, BFS) and finding the paths
Adjacency Matrix
Adjacency List
Robot Path Finder Problem
Finding Connected Components in the graph
Its applications
Finding the shortest path in a graph
Finding DFSpath in Grid Graph
FInding BFSPath in Grid Graph
Lecture 17 - Union Find Data Structure over Disjoint Sets
AND Segregating/Partitioning the Vector
Input: Given Input of Different Disjoint Set
Query 1: Find(x) == Find(y) whether both elements x and y belongs to same Set
Query 2: Union(x, y)
Union by Size
READ about UNION BY RANK (Height of the Set)
Find(x) and Path Compression
Segregating/Partitioning the Vector (Discussion on Quiz)
Load an array (You may use STL vector, you are not allowed to use any extra vector/array). Then move all the 0’s to the left and the 1’s to the right.
Load a list in an array (You may use STL vectors here, you are not allowed to use any extra memory-array-vector). Then move all the even numbers to the left and the odd numbers to the right.
Load a list in an array (You may use STL vectors here, you are not allowed to use any extra memory) and a value T (which will not be in the list). Then move all the numbers smaller than 7 to the left,and all the numbers greater than 7 to the right end of the vector/array.
Load a list in an array (You may use STL vectors here, you are not allowed to use any extra vectors ). Then move all the 0’s to the left and the 2’s to the right, and all the 1’s in the middle.
Load a list in an array (You may use STL vectors here, you are not allowed to use any extra vectors ) and a value T (which will be in the vector). Then move all the numbers smaller than 7 to the left, in the middle all the 7’s and all the numbers greater than 7 to the right end of the array.
Lecture 18 - QuickSort AND Binary Search Tree (Traversals, Searching,
FindMax/Min, Insertion, BinarySearchTree Sort)
Writing Special Randomized Partition
Recursive QuickSort Implementation
Why we moved
Variables to Static Arrays
Static Arrays to Dynamic Growable Arrays
Dynamic Growable Arrays to Vector
Vector to Linked List
Where are we standing now???
Solving the issue of Binary Searching in the Linked List by Introducing
Search (recursive and iterator)
FindMax/FindMin
LNRTraversal
Its Output
BSTAscendingSort
RNLTraversal
Its Output
BSTDescendingSort
Lecture 19 - Binary Search Tree and its Traversal's Applications
Search (recursive and iterator)
FindMax/FindMin
InOrder Traversal
LNRTraversal
Its Output
BSTAscending-Sort
RNLTraversal
Its Output
BSTDescending-Sort
Post Order Traversal
LRN or RLN
Computing Size of the tree
Computing Height of the tree
Computing PrimeCounts
Pre Order Traversal
NLR or NRL
Saving the BST
Loading the BST
Lecture 20 - Binary Search Tree III and its Traversal's Applications
Following Problems were discussed during the lecture
3. Level Order Display (using the Queue)
=> Identifying the end of each level
5. Reflective Tree.
6. Pictorially and data-wise Equal Trees
7. Successor
Adding Parent Pointer in the NODE-struct
Modification in the Insert Function
Lecture 21 - Revision of BST
Following Problems were discussed during the lecture
1. Traversal
i) In Order Traversal(LNR, RNL): Sorting
ii) Pre Prder (NLR, NRL): File Saving...
iii) Post Order (RLN, LRN)
2. PrintSpecial
i) Height of the tree
ii) Size of the tree
iii) Leaves nodes count
iv) SameTrees(BST & A, BST & B)
Lecture 22 - BST (Successor, Predecessor and Delete)
- MinimumSearch - MaximumSearch
- Successor(x) Algo and Implementation in C++
- Predecessor(x) Algo and Implementation in C++
- Implementation of LNRIterator
- Two Same BST (Valuewise) using LNR iterator
-Three Cases
Lecture 25 -Self Balancing Trees, AVL Red Black Trees and Balanced-Tree-Sort
- Adelson, Velski & Landis (AVL Tree)
- Implementation
-Height of AVL Tree
-Insertion in AVL Tree
-Complexity
-Comparison with Red Black Tree.
Lecture 26 -Priority Queue and its Applications (Huffman Coding)
- File Compression
-Shannon signal theory
- Implementation
-File Compression and Decompression Process
-Disk Sort
-Implementation
-Complexity
-Application
-Sorting of Large File
Lecture 27 -Hashing
- Story of Data Structures
-Complexity of other Data-Structures and Hashing
- Implementation of Hash Functions
-Application