Insert in front of the list
Page 1 of 1
Insert in front of the list
public ListNode insertInFront(ListNode list, Object a){
ListNode first=new ListNode(a);
first.next=list;
return first;
}
ListNode first=new ListNode(a);
first.next=list;
return first;
}
Similar topics
» Find if a singly linked List has loop or not. How to find out middle element from a looped single linked list
» Choose data structure to implement insert, get median
» Deleting Elements from List
» Combine two sorted linked list
» Convert any BST into doubly linked list in place
» Choose data structure to implement insert, get median
» Deleting Elements from List
» Combine two sorted linked list
» Convert any BST into doubly linked list in place
Page 1 of 1
Permissions in this forum:
You cannot reply to topics in this forum
|
|