MCS-208 · Unit 3

Lists

8 sections

Block 1 · Unit 3Lists100 min · 8 sections

Unit 3Lists

Follows IGNOU MCS-208, Unit 3

A list is an ordered sequence of items that can grow and shrink: a playlist, a queue of print jobs, the terms of a polynomial. This unit first defines the list as an abstract data type (what it does), then studies two ways to build it (how it is stored): in an array, and as a chain of nodes linked by pointers. The linked versions (singly, doubly and circular linked lists, and skip lists) are the foundation for stacks, queues, trees and graphs in the units that follow.

In this unit you will learn to

  • explain what an abstract data type is and specify the list ADT;
  • implement a list in an array, with insertion, deletion and an overflow check;
  • create, traverse, count and free a singly linked list;
  • insert and delete nodes at the front, in the middle and at the end of a linked list;
  • build doubly linked and circular linked lists and handle their special cases;
  • explain how a skip list makes searching a sorted linked list fast;
  • choose between arrays and the different kinds of linked lists for a given problem.

Sections in this unit

  1. 3.1The List as an Abstract Data TypeWhat an abstract data type is, the list ADT and its operations, and the difference between a specification and an implementation.11 min
  2. 3.2Array Implementation of ListsStoring a list in an array with a counter, inserting and deleting by shifting, the overflow check, and correct versions of Programs 3.1 and 3.2.11 min
  3. 3.3Singly Linked Lists: Nodes, Creation and TraversalNodes and pointers, the empty list, building a singly linked list with malloc, traversing it, counting its nodes and freeing it.11 min
  4. 3.4Insertion and Deletion in a Singly Linked ListInserting at the front, after or before a key, and deleting a node by key in a singly linked list, with all special cases and correct code.15 min
  5. 3.5Doubly Linked ListsNodes with left and right links, traversal in both directions, O(1) deletion of a known node, and a correct version of Program 3.7.14 min
  6. 3.6Circular Linked ListsLists whose last node points back to the first, using a last pointer, safe traversal with do-while, insertion and deletion, and the study material's bugs.14 min
  7. 3.7Skip ListsHow a skip list adds express levels to a sorted linked list so that search, insertion and deletion take O(log n) expected time.12 min
  8. 3.8Applications of Linked ListsPolynomials as linked lists, comparing arrays with linked lists, and real uses of singly, doubly and circular lists, with a fixed Program 3.11.12 min
↑ ↓ move↵ openTab switch type