Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- MAIN()
- IntNode n = new IntNode(5, new IntNode(3, new IntNode(2)));
- Q6(n,5);
- Console.WriteLine(n);
- static IntNode Q6(IntNode b, int n)
- {
- IntNode temp = null;
- IntNode last = b;
- while(last != null)
- {
- if(b.GetInfo() == n)
- {
- temp = b;
- b = b.GetNext();
- temp.SetNext(null);
- }
- last = last.GetNext();
- }
- return b;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement