notes where (isgtis time required to compare two keys if you assume that the time to compare two keys is constantthen you get (log log )where and are the number of internal nodes in trees and respectively public class leftistheap extends binarytree implements mergeablepriorityqueue protected int nullpathlengthpublic void merge (mergeablepriorityqueue queueleflistheap arg (leftistheapqueueif (isempty ()swapcontents (arg)else if (!arg isempty ()if (((comparablegetkey ()isgt ((comparablearg getkey ())swapcontents (arg)getrightheap (merge (arg)if (getleftheap (nullpathlength getrightheap (nullpathlengthswapsubtrees ()nullpathlength math min getleftheap (nullpathlengthgetrightheap (nullpathlength)/program leftistheap class merge method putting items into leftist heap the enqueue method of the leftistheap class is used to put items into the heap enqueue is easily implemented using the merge operation that isto enqueue an item in given heapi simply create new heap containing the one item to be enqueued and merge it with the given heap the algorithm to do this is shown in program public class leflistheap extends binarytree implements mergeablepriorityqueue protected int nullpathlengthpublic void enqueue (comparable objectmerge (new leflistheap (object))/program leftistheap class enqueue method lovely professional university