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

Answer Posted / 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       View All Answers


Please Help Members By Posting Answers For Below Questions

a program that performs some preliminary processing in C, it acts upon certain directives that will affect how the compiler does its work a) compiler b) loader c) directive d) preprocessor

631


How to establish connection with oracle database software from c language?

1669


hi any body pls give me company name interview conduct "c" language only

1659


One of the Institutes contains 5 student groups. Every group contains 4 students. Institute wants to store student group’s details in array. Group should contain group member’s details (name and registration number and age), project name, and mark of the group.

2152


What is 1f in c?

1825






What is scope rule of function in c?

540


How can I split up a string into whitespace-separated fields?

562


What is 1d array in c?

592


What are compound statements?

622


How do we declare variables in c?

561


WRITE A PROGRAM TO MERGE TWO SORTED ARRAY USING MERGE SORT TECHNIQUE..

1585


how to introdu5ce my self in serco

1517


How can variables be characterized?

1637


What does 2n 4c mean?

702


How to get string length of given string in c?

599