Public paste
Undefined
By: Guest | Date: Dec 9 2009 02:53 | Format: None | Expires: never | Size: 300 B | Hits: 1222

  1. public void reverse()
  2. {
  3.         dllintnode temp;
  4.         dllintnode current;
  5.         dllintnode val;
  6.         currentpos = front; // the head of the list
  7.         temp = null;
  8.         val = null;
  9.         while(currentpos != null)
  10.         {
  11.                 temp = currentpos.getNext();
  12.                 val.setBack(currentpos);
  13.                 val = currentpos;
  14.                 currentpos = temp;
  15.         }
  16. }