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 |
What is malloc return c?
write a program which will count occurance of a day between two dates.
Explain what is a 'null pointer assignment' error? Explain what are bus errors, memory faults, and core dumps?
String concatenation
Function shall sum members of given one-dimensional array. However, it should sum only members whose number of ones in the binary representation is higher than defined threshold (e.g. if the threshold is 4, number 255 will be counted and 15 will not) - The array length is arbitrary - output the results to the stdout
Write a program to reverse a given number in c?
Is exit(status) truly equivalent to returning the same status from main?
What are macros in C?
What are the advantages of the functions?
4-Take two sets of 5 numbers from user in two arrays. Sort array 1 in ascending and array 2 in descending order. Perform sorting by passing array to a function mySort(array, sortingOrder). Then multiply both the arrays returned from function, using metric multiplication technique in main. Print result in metric format.
Explain what does a function declared as pascal do differently?
What is integer constants?