Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is there any algorithm with time complexity O(lg * n) (iterated logarithm function)?

In computer science, the iterated logarithm of n, written log* n (usually read "log star"), is the number of times the logarithm function must be iteratively applied before the result is less than or equal to 1. The simplest formal definition is the result of this recursive function:

Is there any algorithm with time complexity O(lg * n) ?

like image 386
Naveen N Avatar asked Sep 27 '22 10:09

Naveen N


1 Answers

If you implement union find algorithm with path compression and union by rank, both union and find will have complexity O(log*(n)).

like image 198
Ivaylo Strandjev Avatar answered Oct 04 '22 22:10

Ivaylo Strandjev