[   ^ to index...   |   next -->   ]

CSE 143/AC : 13 July 2000


Linked lists

A linked list can be defined as either

The front of a list is commonly called its head, and the rest of the list is commonly called its tail (think of tadpoles, not dogs):

generic linked list diagram
class Item { public: Item(); bool equals(Item& other); private: // hidden }; struct ListNode { Item element; ListNode * next; }; typedef ListNode * List; // C-style ADT definition List createList(); void deleteList(List *list); int isEmpty(List list); int length(List list); void insertListItem(List *list, Item item, int position); void removeListItem(List *list, Item item); Item getItemAt(int position);

How would you define 7 operations given above?


Last modified: Wed Jul 12 19:14:52 PDT 2000