Advertisement
Guest User

Untitled

a guest
Jan 20th, 2020
97
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.58 KB | None | 0 0
  1.  
  2.  
  3.  
  4.  
  5. MAIN()
  6. IntNode n = new IntNode(5, new IntNode(3, new IntNode(2)));
  7. Q6(n,5);
  8. Console.WriteLine(n);
  9.  
  10.  
  11. static IntNode Q6(IntNode b, int n)
  12. {
  13. IntNode temp = null;
  14. IntNode last = b;
  15. while(last != null)
  16. {
  17. if(b.GetInfo() == n)
  18. {
  19. temp = b;
  20. b = b.GetNext();
  21. temp.SetNext(null);
  22. }
  23. last = last.GetNext();
  24. }
  25. return b;
  26. }
  27. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement