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 |
A banker has a seif with a cipher. Not to forget the cipher, he wants to write it coded as following: each digit to be replaced with the difference of 9 with the current digit. The banker chose a cipher. Decipher it knowing the cipher starts with a digit different than 9. I need to write a program that takes the cipher from the keyboard and prints the new cipher. I thought of the following: Take the input from the keyboard and put it into a string or an array. Go through the object with a for and for each digit other than the first, substract it from 9 and add it to another variable. Print the new variable. Theoretically I thought of it but I don't know much C. Could you give me any kind of hint, whether I am on the right track or not?
Why cann't whole array can be passed to function as value.
How can you invoke another program from within a C program?
How to write a code for reverse of string without using string functions?
What are qualifiers and modifiers c?
Define C in your own Language.
can you explain in brief what is "r+" mode in a file... i know that it si used to read and modify rhe existing content.... but explalanation about the file pointer in "r+" mode i wann to know???????????
what wud be the output? main() { char *str[]={ "MANISH" "KUMAR" "CHOUDHARY" }; printf("\nstring1=%s",str[0]); printf("\nstring2=%s",str[1]); printf("\nstring3=%s",str[2]); a)string1=Manish string2=Kumar string3=Choudhary b)string1=Manish string2=Manish string3=Manish c)string1=Manish Kumar Choudhary string2=(null) string3=(null) d)Compiler error
Find occurence of a character in a sting.
What does sizeof function do?
Is c is a procedural language?
wite a programme in c to linear search a data using flag and without using flags?