- Engineering
- Computer Science
- assume that a singly linked list is being used to...
Question: assume that a singly linked list is being used to...
Question details
Assume that a singly linked list is being used to implement a dictionary. The four keys in the dictionary are I, M, P, and S. find is performed 12 times, on the sequence I,P,P,I,S,S,I,S,S,I,M,I. How many comparisons are required for each search when the three methods listed below are used? For Move-to-Front and Transpose assume that the list initially contains the keys in the order I, P, S, M (from first to last), while for Best Static Ordering assume that all keys are already listed in decreasing frequency.
Solution by an expert tutor
