If the purpose of this search is to insert another item


Suppose you didn't want to maintain a set of sorted data elements as a tree, but chose a linked list implementation instead, despite its obvious inefficiencies.

The list is ordered by key values in ascending order, that is, the lowest key value is at the head of the list. To locate a data element, you search the list linearly until you find a key value that is greater than the key value of the item's key.

If the purpose of this search is to insert another item into the list, how would you achieve this insertion? In other words, give a pseudocode algorithm that lists each step.

You can make this algorithm some what more efficient by slightly changing the data structure of the list.

Request for Solution File

Ask an Expert for Answer!!
Computer Engineering: If the purpose of this search is to insert another item
Reference No:- TGS01566892

Expected delivery within 24 Hours