Describe a pattern of access to a splay tree that would provide excellent performance. Now describe an access pattern that would provide poor performance.
What will be an ideal response?
Excellent performance would be achieved if the same value was accessed repeatedly in sequence. Good performance would result from accessing a small number of nodes whose values were close together were frequently accessed, for example if the same two nodes were repeatedly accessed more than any other nodes. Poor performance would result if each node was to be accessed exactly once or if nodes whose values are far apart are accessed one after the other repeatedly. The worst case, of course, would be to repeatedly access the smallest (largest) value, then the largest (smallest) value.
Computer Science & Information Technology