Question: Write pseudocode for a linked list swap operation that accepts three parameters - a doubly linked list L, and two pointers a and b
Write pseudocode for a linked list swap operation that accepts three parameters - a doubly linked list L, and two pointers a and b that point to Node elements inside the linked list. Change all the relevant previous and next links so that Nodes a and b swap places within the list. You may assume that Node b comes after Node a in the list, and that they are not the same Node. Make sure you cover all relevant special cases.
Step by Step Solution
There are 3 Steps involved in it
function swapNodesL a b if L is empty or a is None or ... View full answer
Get step-by-step solutions from verified subject matter experts
