Question: 7. Write the following methods for a standard unordered singly linked list. There is a head pointer, but no tail pointer linserts the given key


7. Write the following methods for a standard unordered singly linked list. There is a head pointer, but no tail pointer linserts the given key into the first postition in the list (head) public void insertfirst (intl key) /l inserts the given key at the end of the list (there is no tail pointer public void insertlast(int ke inserts the keyl into the position immediately following the last instance of key2 ll if key2 exists in the list. Othenwise, the keyl is inserted at the end of the list public void AnserAFCER KeyH: nt key2)
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
