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
Tell us two differences between new () and malloc ()?
Is it better to bitshift a value than to multiply by 2?
Can we change the value of constant variable in c?
Why is sprintf unsafe?
What is break statement?
What is a lookup table in c?
What does double pointer mean in c?
Write a C program to accept a matrix of any size. Find the frequency count of each element in the matrix and positions in which they appear in the matrix
What are nested functions in c?
In cryptography, you could often break the algorithm if you know what was the original (plain) text that was encoded into the current ciphertext. This is called the plain text attack. In this simple problem, we illustrate the plain text attack on a simple substitution cipher encryption, where you know each letter has been substituted with a different letter from the alphabet but you don’t know what that letter is. You are given the cipherText as the input string to the function getwordSets(). You know that a plain text "AMMUNITION" occurs somewhere in this cipher text. Now, you have to find out which sets of characters corresponds to the encrypted form of the "AMMUNITION". You can assume that the encryption follows simple substitution only. [Hint: You could use the pattern in the "AMMUNITION" like MM occurring twice together to identify this]
Subtract Two Number Without Using Subtraction Operator
the question is that what you have been doing all these periods (one year gap)
why return type of main is not necessary in linux
typedef enum { html, java, javascript, perl, cgi } lang;The above statement defines a : a) Union b) User defined type c) Enumerated variable d) none
What is the use of volatile?