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 / harish
2(n-1)
| Is This Answer Correct ? | 27 Yes | 28 No |
Post New Answer View All Answers
Write a (n) algorithm that sorts n distinct integers, ranging in size between 1 and kn inclusive, where k is a constant positive integer. (Hint: Use a kn-element array.)
develop a program to calculate and print body mass index for 200 employees
how to diplay a external image of output on winxp by using c & c++,
write a program that reads a series of strings and prints only those strings begging with letter "b"
write a program that prompt the user to enter his height and weight,then calculate the body mass index and show the algorithm used
Performance Algorithm A performs 10n2 basic operations and algorithm B performs 300 lg n basic operations. For what value of n does algorithm B start to show its better performance?
Write a simple encryption program using string function which apply the substitution method.
How can I Draw an ellipse in 3d space and color it by using graph3d?
write a program that can LOCATE and INSERT elements in array using c++ programming languages.
Write a C/C++ program that connects to a MySQL server and displays the global TIMEZONE.
Write a C/C++ program that connects to a MySQL server and checks if the InnoDB plug-in is installed on it. If so, your program should print the total number of disk writes by MySQL.
What output does this program generate as shown? Why? class A { A() { cout << "A::A()" << endl; } ~A() { cout << "A::~A()" << endl; throw "A::exception"; } }; class B { B() { cout << "B::B()" << endl; throw "B::exception"; } ~B() { cout << "B::~B()"; } }; int main(int, char**) { try { cout << "Entering try...catch block" << endl; A objectA; B objectB; cout << "Exiting try...catch block" << endl; } catch (char* ex) { cout << ex << endl; } return 0; }
write a program that creates a sequenced array of numbers starting with 1 and alternately add 1 and then 2 to create the text number in the series , as shown below. 1,33,4,6,7,9,............147,148,150 Then , using a binary search , searches the array 100 times using randomly generated targets in the range of 1 to 150
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)
i don't know about working of nested for loop can any one help me