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


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


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

      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