nextpointer=current.getNext() #storing next pointer of of current node sortednext=sortedCurrent.getNext() #storing next of sorted current node sortedLastCurrent.setNext(current) #set current to next of sorted last current node current.setNext(sortednext) #set next of current to sorted next currentpre.setNext(sortedCurrent) #set next of currentpre to sorted current sortedCurrent.setNext(nextpointer) #set next of sorted current to next pointer sortedCurrent=current #set sorted current to current pointer
temp=node.getData() node.setData(node2.getData()) node2.setData(temp)
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)