📖 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 …
Linked Lists (Singly, Circular, Doubly)
📘 Linked Lists (Singly, Circular, Doubly)
A linked list is a dynamic data structure used to store a sequence of elements where each element (called a node) points to the next. Unlike arrays, linked lists do not require contiguous memory and can grow or shrink at runtime.
🧱 Basic Structure of a Node
struct Node { int data; struct Node* next; };
🔗 Singly Linked List
Each node stores data and a pointer to the next node. The last node points to NULL
.
// Creating nodes and linking struct Node* head = NULL; head = (struct Node*)malloc(sizeof(struct Node)); head->data = 10; head->next = NULL;
➡️ Traversing a Singly Linked List
void printList(struct Node* node) { while (node != NULL) { printf("%d -> ", node->data); node = node->next; } printf("NULL"); }
🔁 Circular Linked List
In a circular linked list, the last node points back to the first node, forming a circle.
- No NULL in the list
- Useful for cyclic operations, e.g., round-robin scheduling
🔄 Doubly Linked List
Each node contains two pointers — one to the next node and one to the previous node.
struct DNode { int data; struct DNode* prev; struct DNode* next; };
- Allows traversal in both directions
- More memory usage due to extra pointer
🔍 Use Cases of Linked Lists
- Dynamic memory allocation without fixed size
- Insertion/deletion without shifting elements
- Implementation of stacks, queues, graphs, adjacency lists
🧪 Example: Insert at Beginning (Singly)
void insertAtBeginning(struct Node** head_ref, int new_data) { struct Node* new_node = (struct Node*)malloc(sizeof(struct Node)); new_node->data = new_data; new_node->next = *head_ref; *head_ref = new_node; }
📚 Practice Tasks
- Create a singly linked list and print it
- Write functions to insert and delete nodes from beginning and end
- Convert singly linked list to circular
- Implement a doubly linked list with backward traversal
✅ Summary
- Linked lists are dynamic and flexible
- Singly → forward only, Circular → circular connection, Doubly → bidirectional
- Used for dynamic data management, memory-efficient operations
📤 Coming Next
In the next chapter, we’ll learn how to implement Stack in C using both Arrays and Linked Lists.