heaps the trickle-up algorithm is somewhat simpler than trickling down because two children don' need to be compared node has only one parentand the target node is simply swapped with its parent in the figure the final correct position for the new node happens to be the rootbut new node can also end up at an intermediate level by comparing figures and you can see that if you remove node and then insert the same node the result is not necessarily the restoration of the original heap given set of nodes can be arranged in many valid heapsdepending on the order in which nodes are inserted not really swapped in figures and we showed nodes being swapped in the trickle-down and trickle-up processes swapping is conceptually the easiest way to understand insertion and deletionand indeed some heap implementations actually use swaps figure shows simplified version of swaps used in the trickle-down process after three swapsnode will end up in position dand nodes bcand will each move up one level swap copy copy swap copy figure temp copy swap aswaps bcopies copy trickling with swaps and copies howevera swap requires three copiesso the three swaps shown in figure take nine copies we can reduce the total number of copies necessary in trickle algorithm by substituting copies for swaps figure shows how five copies do the work of three swaps firstnode is saved temporarily then is copied over ac is copied over band is copied over finallya is copied back from temporary storage onto position we have reduced the number of copies from nine to five in the figure we're moving node three levels the savings in copy time grow larger as the number of levels increases because the two copies from and to temporary