Suppose we need to write an efficient program to store N employee records for ABC Inc where each employee record is identified by unique employee id. Consider the following ways to store the records. 1. An array list sorted by employee id 2. A linked list sorted by employee id 3. A linked list not sorted 4. A balanced binary search tree with employee id as key For data structure 1 -4, what is the average time to find an employee record given employee id as a key? a. O(log N), O(N), O(N), O(log N) O(N), O(log N), O(N), O(1) c. O(log N), O(log N), O(N), O(log N) d. O(log N), O(log N), O(log N), O(1) e. O(log N), O(log N), O(N), O(1)

icon
Related questions
Question

I was told the answer is O(log N), O(N), O(N), O(log N) but I am not sure

Suppose we need to write an efficient program to store N employee records for ABC Inc
where each employee record is identified by unique employee id. Consider the following
ways to store the records.
1. An array list sorted by employee id
2. A linked list sorted by employee id
3. A linked list not sorted
4. A balanced binary search tree with employee id as key
For data structure 1-4, what is the average time to find an employee record given employee
id as a key?
a. O(log N), O(N), O(N), O(log N)
b. O(N), O(log N), O(N), O(1)
c. O(log N), O(log N), O(N), O(log N)
d. O(log N), O(log N), O(log N), O(1)
e. O(log N), O(log N), O(N), O(1)
Transcribed Image Text:Suppose we need to write an efficient program to store N employee records for ABC Inc where each employee record is identified by unique employee id. Consider the following ways to store the records. 1. An array list sorted by employee id 2. A linked list sorted by employee id 3. A linked list not sorted 4. A balanced binary search tree with employee id as key For data structure 1-4, what is the average time to find an employee record given employee id as a key? a. O(log N), O(N), O(N), O(log N) b. O(N), O(log N), O(N), O(1) c. O(log N), O(log N), O(N), O(log N) d. O(log N), O(log N), O(log N), O(1) e. O(log N), O(log N), O(N), O(1)
Expert Solution
trending now

Trending now

This is a popular solution!

steps

Step by step

Solved in 3 steps

Blurred answer