📖 Chapters
- 1. Introduction to DSA and Its Importance
- 2. Time and Space Complexity (Big O, Θ, Ω)
- 3. Recursion and Stack Memory
- 4. Mathematics for DSA (GCD, LCM, Modulo Arithmetic)
- 5. Arrays: Basics and Operations
- 6. Strings: Manipulation & Inbuilt Functions
- 7. Structures and Unions with Arrays
- 8. Linked Lists (Singly, Circular, Doubly)
- 9. Stack (Using Array & Linked List)
- 10. Queue (Simple, Circular, Deque)
- 11. Linear Search & Binary Search
- 12. Sorting Basics: Bubble, Selection, Insertion
- 13. Merge Sort
- 14. Quick Sort
- 15. Counting Sort, Radix Sort, Bucket Sort
- 16. Heap Sort
- 17. Binary Trees & Representations
- 18. Binary Tree Traversals (Pre, In, Post)
- 19. Binary Search Tree (BST)
- 20. AVL Trees (Self-balancing BST)
- 21. Trie (Prefix Tree)
- 22. Segment Tree (Range Queries)
- 23. Fenwick Tree / Binary Indexed Tree (BIT)
- 24. Heap & Priority Queues (Min-Heap, Max-Heap)
- 25. Hashing and Hash Tables
- 26. Disjoint Set Union (Union-Find, Path Compression)
- 27. Sparse Tables
- 28. Sliding Window Technique
- 29. Two Pointers Technique
- 30. Graph Representations (Adjacency Matrix & List)
- 31. BFS and DFS (Traversal & Search)
- 32. Topological Sort (Kahn’s & DFS)
- 33. Shortest Path Algorithms (Dijkstra, Bellman-Ford)
- 34. Minimum Spanning Tree (Kruskal, Prim)
- 35. Cycle Detection in Graphs
- 36. Bridges and Articulation Points
- 37. Greedy Algorithms (Activity Selection, Huffman Coding)
- 38. Backtracking (N-Queens, Sudoku Solver)
- 39. Dynamic Programming (Intro, Memoization, Tabulation)
- 40. Advanced DP (LIS, Knapsack, DP on Trees/Grids)
- 41. Bit Manipulation and XOR Tricks
- 42. Interview Problems from FAANG Companies
- 43. Competitive Coding Patterns
- 44. Building Mini Projects Using DSA (Menu-driven)
- 45. Final Quiz + Problem Sheet (100+ questions)
- 46. Next Steps: Competitive Programming or System Design?
Data Structures and Algorithms in C (DSA)
Category: IT Fundamentals & Programming
This course is designed to help learners master the core concepts of Data Structures and Algorithms (DSA) using the C programming language. Starting from the basics and advancing to complex topics like graphs, dynamic programming, and memory optimization, this course …
Arrays: Basics and Operations
📘 Arrays – Basics and Operations
Arrays are the most fundamental data structure in programming. They provide a way to store multiple values of the same type in a contiguous block of memory. In C, arrays are zero-indexed and require fixed size at compile time (unless dynamically allocated).
📦 What is an Array?
An array is a collection of elements of the same data type placed in contiguous memory locations and accessed using an index.
// Declaration & Initialization int marks[5]; // declares array of size 5 int scores[5] = {80, 90, 85, 75, 95};
📌 Accessing Array Elements
- Index starts at 0
scores[2]
gives 3rd element →85
- Can be updated:
scores[0] = 100;
🔁 Traversing an Array
for (int i = 0; i < 5; i++) { printf("%d ", scores[i]); }
📊 Real-Life Example (UdaanPath)
Suppose UdaanPath is storing marks of 5 students in an online quiz:
int student_marks[5] = {80, 75, 90, 85, 70}; int total = 0; for (int i = 0; i < 5; i++) { total += student_marks[i]; } float average = total / 5.0; printf("Average Marks = %.2f", average);
🔢 Types of Arrays
- 1D Array: Simple linear list (e.g.,
int arr[10];
) - 2D Array: Matrix format (e.g.,
int arr[3][3];
) - Multidimensional Array: Higher dimensional data like 3D arrays
🧮 2D Array Example
int matrix[2][3] = { {1, 2, 3}, {4, 5, 6} }; for (int i = 0; i < 2; i++) { for (int j = 0; j < 3; j++) { printf("%d ", matrix[i][j]); } printf("\n"); }
⚙️ Array Operations
- Insertion
- Deletion (logical only, actual size fixed)
- Traversal
- Searching (Linear or Binary)
- Updating values
📌 Limitations of Arrays
- Fixed size → need to know size at compile time
- Insertion/deletion is costly (O(n) time)
- Not suitable when frequent resizing is required → use linked lists
📚 Practice Tasks
- Find the max and min in an array of 10 integers
- Write a function to reverse an array in-place
- Count how many even numbers are in the array
- Insert a value at a specific index in an array
✅ Summary
- Arrays are fundamental and efficient for fixed-size collections
- Best suited for random access and indexing
- For dynamic memory, consider using pointers and malloc
📤 Coming Next
Next, we’ll dive into Strings in C — learn how to work with character arrays and manipulate text efficiently.