TransWikia.com

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.
Thanks

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!

Ask a Question

Get help from others!

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