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

Linked list ADT (C++-style)


class Item { public: Item(); bool equals(Item& other); private: // hidden }; struct ListNode { Item element; ListNode * next; }; class LinkedList { public: LinkedList(); bool isEmpty(); int length(); void insert(int position, Item item); Item delete(int position); Item get(int position); private: ListNode * head; };
Last modified: Wed Jul 12 19:22:41 PDT 2000