Inactive Tutor answered 01/29/21
Which one is the middle the 10th or 11th?
Update ( list, entry, indexpos)
If indexpos<list.Count
List.cur= head
For i=0 to indexpos-1
List.cur = list.cur.next
List.cur.data = entry
Else
Error Invalid index
Endif
Zarar K.
asked 10/08/20 Suppose a linked list of 20 nodes. The middle node has a data –250. Write the pseudocode to replace the middle node of the linked list with a new node and new data. Assume that the list's head pointer is called head_ptr and the data for the new node is called entry
Inactive Tutor answered 01/29/21
Which one is the middle the 10th or 11th?
Update ( list, entry, indexpos)
If indexpos<list.Count
List.cur= head
For i=0 to indexpos-1
List.cur = list.cur.next
List.cur.data = entry
Else
Error Invalid index
Endif
Get a free answer to a quick problem.
Most questions answered within 4 hours.
Choose an expert and meet online. No packages or subscriptions, pay only for the time you need.