Semester 2Year 1 · EvenCore Subject★★★★★ Hard
CS 102

Data Structures

Fundamental data structures and their implementations including arrays, linked lists, stacks, queues, trees, and graphs.

3Units
15Topics
4Credits
60hLecture hrs
100Max marks
Your Progress
0 / 15 topics
0% complete
Overview
🎯
Why it matters
Data Structures is the foundation of computer science. Every Google search, every Facebook feed, every Uber route — they all run on the concepts you'll learn here. Master this, and you unlock the ability to solve real-world problems efficiently.
💼
Placement relevance
90% of FAANG interviews ask DS questions. Amazon asks trees/graphs. Google loves hashmaps. Microsoft tests linked lists. This subject directly translates to ₹15-30 LPA offers. LeetCode top 150 problems are all from this syllabus.
🔗
Prerequisites for
Algorithms · Operating Systems · DBMS · Compiler Design · Machine Learning · System Design · Competitive Programming
📚
Recommended books
Introduction to Algorithms by Cormen, Leiserson, Rivest, Stein (CLRS) · Data Structures and Algorithms Made Easy by Narasimha Karumanchi · Data Structures Using C by Reema Thareja · Fundamentals of Data Structures by Horowitz and Sahni
Curriculum — 3 Units
U1
Unit 1 · 5 Topics · 0% complete
Linear Data Structures
Key Formulae
Array Access:Address = Base + (index × size)
Stack Operations:Push: arr[++top] = x; Pop: x = arr[top--]
Queue Operations:Enqueue: rear = (rear+1)%n; Dequeue: front = (front+1)%n
Arrays
Linked Lists
Stacks
Queues
Priority Queues
U2
Unit 2 · 6 Topics · 0% complete
Non-linear Data Structures
Key Formulae
Tree Height:height = log₂(n+1) for complete binary tree
BST Search:O(log n) average, O(n) worst case
AVL Balance Factor:BF = height(left) - height(right); must be -1, 0, or 1
Heap Parent/Child:parent = (i-1)/2; left = 2i+1; right = 2i+2
Trees
Binary Trees
BST
AVL Trees
Heaps
Graphs
U3
Unit 3 · 4 Topics · 0% complete
Algorithm Analysis
Key Formulae
Big O Classes:O(1) < O(log n) < O(n) < O(n log n) < O(n²) < O(2ⁿ)
Master Theorem:T(n) = aT(n/b) + f(n)
Amortized Analysis:Average cost = Total cost / Number of operations
Time Complexity
Space Complexity
Big O Notation
Algorithm Design
Previous Year Questions
Unit 22023 · End Semester10 marks
Implement an AVL tree with insertion and rotation operations. Show step-by-step insertion of elements {10, 20, 30, 40, 50, 25} and perform necessary rotations to maintain balance.
Unit 12023 · Mid Semester8 marks
Write a C program to reverse a linked list using iterative and recursive approaches. Analyze the time and space complexity of both methods.
Unit 22023 · End Semester10 marks
Implement Dijkstra's shortest path algorithm using an adjacency matrix representation. Find the shortest path from source vertex A to all other vertices in a weighted graph.
Unit 12022 · End Semester8 marks
Implement a Queue using two Stacks. Write functions for enqueue and dequeue operations. What is the time complexity of each operation?
Unit 32022 · Mid Semester6 marks
Explain the Master Theorem for solving recurrence relations. Apply it to solve: T(n) = 4T(n/2) + n²
Exam Strategy
🎯
Master the Big 3
Trees, Graphs, and Linked Lists appear in EVERY exam. Practice at least 20 problems each. Can you reverse a linked list in your sleep? Can you do BFS/DFS with eyes closed? That's your target.
💡
Draw before you code
Always draw the data structure first. For trees, draw nodes. For linked lists, draw arrows. Examiners give partial marks for correct diagrams even if code has bugs. Visual thinking prevents logic errors.
Time complexity is 40% weightage
Every question asks 'Analyze complexity'. Memorize: Arrays O(1) access, LinkedList O(n) search, BST O(log n) average, Graphs O(V+E) for traversal. Write Big O notation for every function you write.
🔁
Code by hand, not IDE
Exams are pen-paper. Practice writing code on paper without syntax highlighting or autocomplete. Common mistakes: forgetting NULL checks, off-by-one errors in loops, wrong pointer assignments.
📝
Recursion + Base Case
Tree problems = recursion. Always write base case first (if root == NULL). Then write recursive case. Practice: preorder, inorder, postorder, height calculation, mirror tree.
Related Subjects
Semester 3
Algorithms
CS 301
Semester 4
Operating Systems
CS 401
Semester 4
Database Management Systems
CS 402
Semester 5
Design and Analysis of Algorithms
CS 501