CMP160 Data Structure and Algorithms

Data Structure and Algorithms notes

10 chapter notes, in syllabus order. Each starts with the key points.

Unit 1

Data Structures: Definitions, Types, Operations & Real-World UseUnit 1 of Data Structure and Algorithms introduces the core concepts of data structures—what they are, why they matter, their classifications, and fundamental operations like insertion, deletion, and traversal—with visual examples from Nepalese apps (eSewa, Daraz) and everyday life.9 min read

Unit 2

Stack: Operations, Applications & Real-World UseUnit 2 of Data Structure and Algorithms explores the stack—its definition, operations (push, pop, peek, isEmpty), implementations (array vs. linked list), and applications in parsing, undo mechanisms, and memory management. Includes real-world examples, visual traces, and exam-focused comparisons.11 min read

Unit 3

Queues: Operations, Implementations & ApplicationsUnit 3 of Data Structure and Algorithms explores queues—linear data structures following FIFO (First-In-First-Out) principle—covering their definitions, real-world analogies, implementations (arrays/linked lists), operations (enqueue/dequeue), and applications in scheduling, buffering, and resource management.6 min read

Unit 4

Recursion: Definition, Mechanics, Applications & AnalysisUnit 4 of Data Structure and Algorithms explores recursion—how functions call themselves to solve problems by breaking them into smaller subproblems. This note covers base cases, recursive cases, trace diagrams, tail recursion, and real-world applications in algorithms, data structures, and programming (e.g., tree trav10 min read

Unit 5

Linked Lists: Types, Operations, and ApplicationsUnit 5 of Data Structure and Algorithms covers singly and doubly linked lists, their operations (insertion, deletion, traversal), time/space complexity, and comparisons with arrays. It also explores circular linked lists, polynomial representation, and real-world uses in memory management, undo operations, and music pl10 min read

Unit 6

Trees: Types, Traversals, BSTs, AVL Trees & ApplicationsUnit 6 of Data Structure and Algorithms covers tree structures—hierarchical data models with nodes and edges—including binary trees, binary search trees (BSTs), AVL trees, tree traversals (DFS/BFS), and real-world applications like file systems, organizational charts, and decision trees in machine learning.10 min read

Unit 7

Binary Search Trees & AVL Trees: Balancing, Operations & Self-BalancingUnit 7 of Data Structure and Algorithms explores Binary Search Trees (BSTs)—their structure, insertion/deletion/search operations, and their time complexity—then introduces AVL Trees as a self-balancing solution to maintain O(log n) operations, with rotations, balancing rules, and real-world applications in databases a8 min read

Unit 8

Sorting Algorithms: Techniques, Analysis & ApplicationsUnit 8 of Data Structure and Algorithms covers fundamental sorting techniques (Bubble, Selection, Insertion, Merge, Quick, Heap), their time/space complexity, stability, and real-world applications in Nepalese tech (eSewa, Ncell, Daraz) and global systems (Google, WhatsApp). Includes visual traces of each algorithm, co15 min read

Unit 9

Searching & Hashing: Techniques, Analysis & ApplicationsUnit 9 of Data Structure and Algorithms explores searching algorithms (linear, binary, interpolation) and hashing (tables, collisions, load factor), their time complexities, and real-world implementations in databases, compilers, and web services. Includes comparisons, code traces, and exam-focused insights.8 min read

Unit 10

Graphs: Representations, Traversals, Shortest Paths & ApplicationsUnit 10 of Data Structure and Algorithms covers graph theory fundamentals—graph types, representations (adjacency matrix, list), traversal algorithms (BFS/DFS), minimum spanning trees (Prim’s/Kruskal’s), shortest paths (Dijkstra’s), and real-world applications in routing, networks, and social structures.8 min read