how to determine the complexity of an algorithm as log(n)



how to determine the complexity of an algorithm as log(n)..

Answer / karthik

log(n) is depth of binary tree containing n-elements..
so if we split array into two and omit one part and consider
another part... and continue this process.....
in problems like this the complexity will be log(n)..

Is This Answer Correct ?    1 Yes 1 No

Post New Answer

More C Interview Questions

In which area global, external variables are stored?

3 Answers  


Can we use visual studio for c?

0 Answers  


How do I swap bytes?

0 Answers  


How many types of functions are there in c?

0 Answers  


Is c dynamically typed?

0 Answers  


What is a stream in c programming?

0 Answers  


List some of the static data structures in C?

0 Answers  


inline function is there in c language?

4 Answers  


How to swap two values using a single variable ? condition: Not to use Array and Pointer ?

6 Answers  


What is the difference between c &c++?

0 Answers  


#define DCHAR char* typedef char* TCHAR; if using these following variables will be declared like DCHAR ch1, ch2; TCHAR ch3, ch4; then what will be types of ch1, ch2, ch3 and ch4?

6 Answers   NDS,


What is pointer in c?

0 Answers  


Categories