speed of preorder traversal

Computer Science Asked by keith Paton on February 8, 2021

I want to know the speed of preorder traversal of an tree. I do not mean its order of magntude which we know is O(n).
I want something like 27n operations where an operation is precisely defined.

One Answer

It's not answerable in the abstract, without a lot more specifics. It depends on intimate specifics of the computer architecture, what counts as "one" operation, how the tree is represented, and many other details that are usually considered a distraction for purposes of analysis of algorithms. And it wouldn't really be useful in practice anyway; these days, the time it takes for an algorithm to complete depends on a lot more than the number of operations. Not all operations take the same amount of time, and more importantly, the memory hierarchy plays a huge role in influencing the running time, and you can't measure its impact by counting operations.

Answered by D.W. on February 8, 2021

Add your own answers!

Related Questions

Design of a synchronized clock

0  Asked on October 21, 2021 by ahmedou


How private IP address is determined?

1  Asked on October 21, 2021 by nurin-izzati-jafri


Race Condition in Mesa Monitor

0  Asked on October 21, 2021 by heroman


Counting one’s in a stream of bits

0  Asked on October 21, 2021 by srajan


Find original array from array with pairs of adjacent elements

1  Asked on October 21, 2021 by james-flanagin


Ask a Question

Get help from others!

© 2023 All rights reserved. Sites we Love: PCI Database, UKBizDB, Menu Kuliner, Sharing RPP