public void Reverse()    {       Node t = Start , temp;       while (t != null)       {          temp = t.next;          t...
O STADYAR .O RG                      Node t = Start , temp;start                   next                 next              ...
O STADYAR .O RG                      temp = t.next;start                   next                 next              next    ...
O STADYAR .O RG                      t.next = t.prev;start                   next                  next              next ...
O STADYAR .O RG                      t.prev = temp;start                   next                 next              next    ...
O STADYAR .O RG                      t = t.prev;start                   next                  next              next      ...
O STADYAR .O RG    while (t != null)          {             temp = t.next;             t.next = t.prev;             t.prev...
O STADYAR .O RG                      temp = t.next;start                   next                 next              next    ...
O STADYAR .O RG                      t.next = t.prev;start                   next                  next              next ...
O STADYAR .O RG                      t.prev = temp;start                   next                 next              next    ...
O STADYAR .O RG                      t = t.prev;start                   next                  next              next      ...
O STADYAR .O RG    while (t != null)          {             temp = t.next;             t.next = t.prev;             t.prev...
O STADYAR .O RG                      temp = t.next;start                   next                 next              next    ...
O STADYAR .O RG                      t.prev = temp;start                   next                 next              next    ...
O STADYAR .O RG                      t = t.prev;start                   next                  next              next      ...
O STADYAR .O RG    while (t != null)          {             temp = t.next;             t.next = t.prev;             t.prev...
O STADYAR .O RG                      temp = t.next;start                   next                 next              next    ...
O STADYAR .O RG                      t.next = t.prev;start                   next                  next              next ...
O STADYAR .O RG                      t.prev = temp;start                   next                 next              next    ...
O STADYAR .O RG                      t = t.prev;start                   next                  next              next      ...
O STADYAR .O RG    while (t != null)      False          {             temp = t.next;             t.next = t.prev;        ...
O STADYAR .O RG                      temp = Start;start                   next                 next              next     ...
O STADYAR .O RG                         Start = End;start                       next                 next              nex...
O STADYAR .O RG                         End = temp;start                       next                 next              next...
Upcoming SlideShare
Loading in …5
×

Ostadyar

281 views

Published on

Published in: Education, Business, Technology
  • Be the first to comment

  • Be the first to like this

Ostadyar

  1. 1. public void Reverse() { Node t = Start , temp; while (t != null) { temp = t.next; t.next = t.prev; t.prev = temp; t = t.prev; } temp = Start; Start = End; End = temp; }O STADYAR .O RG
  2. 2. O STADYAR .O RG Node t = Start , temp;start next next next next 1 2 3 4 prev prev prev prev end t temp
  3. 3. O STADYAR .O RG temp = t.next;start next next next next 1 2 3 4 prev prev prev prev end t temp
  4. 4. O STADYAR .O RG t.next = t.prev;start next next next next 1 2 3 4 prev prev prev prev end t temp
  5. 5. O STADYAR .O RG t.prev = temp;start next next next next 1 2 3 4 prev prev prev prev end t temp
  6. 6. O STADYAR .O RG t = t.prev;start next next next next 1 2 3 4 prev prev prev prev end t temp
  7. 7. O STADYAR .O RG while (t != null) { temp = t.next; t.next = t.prev; t.prev = temp; t = t.prev; }
  8. 8. O STADYAR .O RG temp = t.next;start next next next next 1 2 3 4 prev prev prev prev end t temp
  9. 9. O STADYAR .O RG t.next = t.prev;start next next next next 1 2 3 4 prev prev prev prev end t temp
  10. 10. O STADYAR .O RG t.prev = temp;start next next next next 1 2 3 4 prev prev prev prev end t temp
  11. 11. O STADYAR .O RG t = t.prev;start next next next next 1 2 3 4 prev prev prev prev end t temp
  12. 12. O STADYAR .O RG while (t != null) { temp = t.next; t.next = t.prev; t.prev = temp; t = t.prev; }
  13. 13. O STADYAR .O RG temp = t.next;start next next next next 1 2 3 4 prev prev prev prev end t temp
  14. 14. O STADYAR .O RG t.prev = temp;start next next next next 1 2 3 4 prev prev prev prev end t temp
  15. 15. O STADYAR .O RG t = t.prev;start next next next next 1 2 3 4 prev prev prev prev end t temp
  16. 16. O STADYAR .O RG while (t != null) { temp = t.next; t.next = t.prev; t.prev = temp; t = t.prev; }
  17. 17. O STADYAR .O RG temp = t.next;start next next next next 1 2 3 4 prev prev prev prev end t temp
  18. 18. O STADYAR .O RG t.next = t.prev;start next next next next 1 2 3 4 prev prev prev prev end t temp
  19. 19. O STADYAR .O RG t.prev = temp;start next next next next 1 2 3 4 prev prev prev prev end t temp
  20. 20. O STADYAR .O RG t = t.prev;start next next next next 1 2 3 4 prev prev prev prev end t temp
  21. 21. O STADYAR .O RG while (t != null) False { temp = t.next; t.next = t.prev; t.prev = temp; t = t.prev; } temp = Start; Start = End; End = temp;
  22. 22. O STADYAR .O RG temp = Start;start next next next next 1 2 3 4 prev prev prev prev end t temp
  23. 23. O STADYAR .O RG Start = End;start next next next next 1 2 3 4 prev prev prev prev end t temp
  24. 24. O STADYAR .O RG End = temp;start next next next next 1 2 3 4 prev prev prev prev end t temp

×