next up previous
Next: Sorted Double List Up: CSE 2320: Algorithms and Previous: Doubly-Linked List

Operations

   Insert(L,x)
      next(x) = head(L)
      if head(L) <> NIL
      then prev(head(L)) = x
      head(L) = x
      prev(x) = NIL



\psfig{figure=figures/f12-11.ps}

Min, Max, Successor, Predecessor, Search: same as for unsorted singly-linked lists

   Delete(L,x)
      if prev(x) <> NIL
      then next(prev(x)) = next(x)
      else head(L) = next(x)
      if next(x) <> NIL
      then prev(next(x)) = prev(x)



Copyright © 1998 The University of Texas at Arlington