1. Engineering
  2. Computer Science
  3. assume that a singly linked list is being used to...

Question: assume that a singly linked list is being used to...

Question details

Problem 2.8 (15 Points) Assume that a singly linked list is being used to implement a dictionary. The four keys in the dictio- nary 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 Move-to-Front Strategy Transpose Strategy Best Static Ordering

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
Blurred Solution
This question has been solved
Subscribe to see this solution