Angel8960 Angel8960
  • 23-08-2019
  • Computers and Technology
contestada

The efficiency for recursively traversing a chain of linked nodes is

A.O(n2)

B. O(1)

C.it cannot be proven

D.O(n)

Respuesta :

ExieFansler ExieFansler
  • 26-08-2019

Answer:

D. O(n).

Explanation:

A chain of linked nodes also known as linked list.So the efficiency of recursively traversing the linked list is O(n) because in recursion it has to traverse over the full linked list.Go to every node and then to it's next there are no other paths to reach to the last there is only one path that goes through every node so the time complexity will be O(n).

Answer Link

Otras preguntas

Advantages and disadvantages of American forces during the revolutionary war
PLEASE HELP 20 POINTS ANSWER FAST ITS A TEST Indicate the method you would use to prove the two 's . If no method applies, enter "none". SSS SAS ASA AAS None
Based on the two graphs, which school would you expect to have a higher standard deviation from the mean and why?
Why does solomon lie about able to read and write
Can you solve this for me please in a good way
I’m always being set aside by my friends. Why should I do?
You walk 20 m north, then 5 meters south . What is your displacement?
PLEASE PLEASE HELP THE MATCH There never was a time when the world was without fire, but there was a time when men did not know how to kindle fire; and after
Sharma is building a shed and wants to determine the measurements for the roof. The span of the roof will be 10 feet and she plans to use a 5:12 roof pitch. Thi
The job market aint getting any better, so you might as well go back to school