Skip to content
Azhimathi Mayam logoDSA Study HubPCCST303 · KTU · S3
Module 2 · 11 hours

Linked List and Memory Management

Official syllabus text (word for word)

Linked List and Memory Management — Singly Linked List - Operations on Linked List, Stacks and Queues using Linked List, Polynomial representation using Linked List; Doubly Linked List; Circular Linked List; Memory allocation - First-fit, Best-fit, and Worst-fit allocation schemes; Garbage collection and compaction.

  1. 1
    Singly linked lists and their operations

    Nodes that point to the next node: create, traverse, count, find the largest, insert, delete, search and append.

    lesson livevisualizerC codeasked 9×
  2. 2
    Stacks and queues using linked lists

    A stack and a queue that never overflow (until memory runs out) — built from linked nodes.

    lesson livevisualizerC code
  3. 3
    Polynomials using linked lists

    Each term becomes a node (coef, expon, link); add two polynomials by walking both lists together.

    lesson livevisualizerC codeasked 2×
  4. 4
    Doubly linked lists

    Two links per node — walk forward AND backward; insert or delete without hunting for the previous node.

    lesson livevisualizerC codeasked 3×
  5. 5
    Circular linked lists

    The last node points back to the first: no NULL at the end, and O(1) insertion at both ends with a single last pointer.

    lesson livevisualizerC codeasked 1×
  6. 6
    Memory allocation: first-fit, best-fit, worst-fit

    Where does malloc find space? First-fit, best-fit and worst-fit, fragmentation, and both KTU allocation questions solved.

    lesson livevisualizerC codeasked 2×
  7. 7
    Garbage collection and compaction

    Finding memory nobody can reach any more (mark & sweep), and squeezing the holes together (compaction).

    lesson livevisualizerC code