Data Structures Notes | B.Sc. (Computer Science) Semester 3 | Mumbai University | munotes
Official Notes munotes.in
Data Structures
B.SC. (COMPUTER SCIENCE) · SEMESTER 3
Strictly as per the University of Mumbai NEP syllabus in force for B.Sc. (Computer Science)
For B.Sc. (Computer Science) students of the University of Mumbai and all its affiliated colleges
Open the book ↓munotes.in Second Year
Contents
Module I Abstract Data Type, Linked Structures, Stacks and Queues
- What a Data Structure Is, and Why the One You Pick Decides Whether the Program Works 1
- How This Paper Is Examined, and How to Read This Book 5
- Data and Its Types: What a Type Actually Settles 8
- The Primitive Types, and Where They Stop 11
- Linear and Non-Linear, Static and Dynamic: The Map of the Subject 14
- Choosing a Structure: The Three Questions to Ask of Any of Them 17
- The Abstract Data Type: A Promise, and a Hidden Representation 20
- Why Hiding the Representation Is the Whole Point 23
- Writing an ADT of Your Own 26
- Judging an ADT: Complete, Minimal, and Honest About Cost 29
- The Array: What It Really Is in Memory 32
- Where the Array Stops: Insertion, Deletion and Growth 35
- The Linked List: The Node, the Chain and the Head 38
- The Linked List ADT, and Building an Empty One 41
- Traversing a Singly Linked List 44
- Searching a Singly Linked List 47
- Prepending a Node 50
- Appending a Node, and Why It Costs More 53
- Removing a Node 56
- Inserting and Deleting at Any Position 59
- What a Singly Linked List Is Good and Bad At 62
- The Array Against the Linked List, Measured 65
- A Polynomial as a Linked List 68
- Adding Two Polynomials 71
- Multiplying Polynomials, and What the Representation Costs 74
- The Doubly Linked List: The Second Link 77
- Insertion and Deletion With Two Links 80
- Traversing Both Ways, and the Applications That Need It 84
- What the Second Link Costs and What It Buys 87
- The Stack: One End, and Why That Is Enough 90
- The Stack ADT: Push, Pop, and the Errors 93
- A Stack on an Array, With Peek 96
- A Stack on Links 99
- What a Stack Is Good and Bad At 102
- Balanced Delimiters, and Why a Counter Is Not Enough 105
- Infix, Prefix and Postfix 108
- Infix to Postfix With a Stack 111
- Evaluating a Postfix Expression 114
- Prefix: Converting to It, and Evaluating It 118
- The Queue: Two Ends 122
- The Queue ADT 125
- A Queue on an Array, and the Drift That Ruins It 128
- A Queue on Links 131
- The Circular Queue: Wrap-Around 134
- Full or Empty: Telling Them Apart 137
- What a Queue Is Good and Bad At 140
- The Deque: Open at Both Ends 143
- Job Scheduling With a Queue 146
- Module 1 in One Sitting 149
Module II Trees, Priority Queues and Heaps, Graphs and Hashing
- From a Line to a Tree: Why Linear Structures Run Out 153
- The Tree ADT: The Words, Said Exactly 156
- Height, Depth, Level and Size, and the Relations Between Them 159
- What a Tree Buys, and What It Costs 162
- The Binary Tree 165
- Binary Tree Properties, Proved 168
- Full, Complete and Perfect, and Why the Difference Matters 171
- Implementing a Binary Tree With Links 174
- The Array Representation of a Binary Tree 177
- Inorder Traversal 180
- Preorder and Postorder Traversal 183
- Level Order Traversal, and the Queue It Needs 186
- Iterative Traversal, and the Stack It Needs 189
- Rebuilding a Tree From Two Traversals 192
- The Binary Search Tree: The Invariant 196
- Searching a Binary Search Tree 199
- Inserting Into a Binary Search Tree 202
- Deleting From a Binary Search Tree: The Three Cases 205
- Why a Binary Search Tree Degenerates 209
- What Balance Means 212
- Threaded Binary Trees 216
- The AVL Tree and the Balance Factor 220
- The Four Rotations 223
- Insertion Into an AVL Tree 227
- Deletion From an AVL Tree 231
- Huffman Coding: The Problem 235
- Building the Huffman Tree 238
- Why the Huffman Code Is Prefix-Free, and What It Saves 241
- The Priority Queue: When First In Is the Wrong Rule 246
- The Priority Queue ADT 249
- Three Ways to Build One, and What Each Costs 252
- The Heap: Shape and Order 255
- The Array That Holds a Heap 259
- Min-Heap and Max-Heap 263
- Heapify: Sifting Up and Sifting Down 266
- Building a Heap, and Why It Is Linear 270
- Where Priority Queues Are Used 275
- What a Graph Is 279
- The Vocabulary of Graphs 282
- The Graph ADT 285
- The Adjacency Matrix 288
- The Adjacency List 291
- Which Representation: The Costs, Measured 294
- Inserting and Deleting Vertices and Edges 299
- Breadth First Search 305
- Depth First Search 310
- Connectivity and Connected Components 315
- The Shortest Path in an Unweighted Graph 320
- Dijkstra's Algorithm 324
- The Idea of Hashing: A Key Turned Into an Address 331
- The Hash Table ADT 337
- Hash Functions 342
- What Makes a Hash Function Good 351
- Collisions Are Certain, Not Unlucky 358
- Chaining 365
- Linear Probing 371
- Quadratic Probing and Double Hashing 380
- Load Factor and Rehashing 388
- What Hashing Buys and What It Gives Up 395
- Where Hashing Is Used, and Where It Must Not Be 400
- Choosing the Right Structure: The Whole Paper on One Page 406
- Module 2 in One Sitting 411
The chapters
Every chapter of this book comes with the B.Sc. (Computer Science) Semester 3 notes.
The cover and the contents are free to look through. Buy the notes once to read every chapter of every subject in this semester.
Notes + practical solutions + solved papers: ₹798 Already bought it? Sign in
Or notes + practical solutions: ₹499
Or solved papers only: ₹499
Free either way: question papers, the syllabus, and the cover and contents of every book.
The rest of this subject
These notes are cut from the University's printed syllabus. Open the syllabus itself, or the past papers, for the same subject.