Min-Max
Write an algorithm that finds both the smallest and
largest numbers in a list of n numbers and with complexity
T(n) is at most about (1.5)n comparisons.
Answer Posted / rajashree
3n/2-2
| Is This Answer Correct ? | 7 Yes | 0 No |
Post New Answer View All Answers
write a program that reverses the input number of n.Formulate an equation to come up with the answer.
How can I Draw an ellipse in 3d space and color it by using graph3d?
can you please write a program for deadlock that can detect deadlock and to prevent deadlock.
write a program to calculate the amount of investment after a period n years if the principal investors was p and interest is calculated using compound interest,formular=a=p(1+r)^n
Write a C/C++ program that connects to a MySQL server and displays the global TIMEZONE.
how to write a program that opens a file and display in reverse order?
Given a table of the form: Product Sold on A 1/1/1980 B 1/1/1980 C 1/1/1980 A 1/1/1980 B 1/1/1980 C 2/1/1980 A 2/1/1980 There are 30 products and 10,000 records of such type. Also the month period during which sales happened is given to u. Write the program to display the result as: Product Month No. of copies A January 12 A February 15 A March 27 B January 54 B February 15 B March 10 C January 37
write a program using 2 D that searches a number and display the number of items 12 inputs values input 15,20, 13, 30, 38, 40,16, 18, 20 ,18 ,20 enter no. to search : 20
Given a table of the form: Product Sold on A 1/1/1980 B 1/1/1980 C 1/1/1980 A 1/1/1980 B 1/1/1980 C 2/1/1980 A 2/1/1980 There are 30 products and 10,000 records of such type. Also the month period during which sales happened is given to u. Write the program to display the result as: Product Month No. of copies A January 12 A February 15 A March 27 B January 54 B February 15 B March 10 C January 37
solve the problem in the programming language C++"if a five digit number is input through the keyboard.Write a program to calculate the sum of its digits(hint: use the modulus operator)
U hv to enter a range from a and b and search hw many no. of times a pattern n. occurs between the range a and b. Eg :i/p:enter range :0 100 Enter pattern: 13 o/p: the no. times 13 occurred betwwn 0 to 100:1 Eg :i/p:enter range :100 1000 Enter pattern: 13 o/p: the no. times 13 occurred betwwn 100 to 1000: (in this 13,113,131,132,133…139,213,313,…913 all these will be counted)
Code for Method of Handling Factorials of Any Size?
Code for Small C++ Class to Transform Any Static Control into a Hyperlink Control?
how to take time as input in the format (12:02:13) from user so that controls remains between these columns?
1+1/2!+1/3!+...+1/n!