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


Please Help Members By Posting Answers For Below Questions

We need to write the function to check the password entered is correct or not based on the following conditions.. a) It must have atleast one lower case character and one digit. b)It must not have any Upper case characters and any special characters c) length should be b/w 5-12. d) It should not have any same immediate patterns like abcanan1 : not acceptable coz of an an pattern abc11se: not acceptable, coz of pattern 11 123sd123 : acceptable, as not immediate pattern adfasdsdf : not acceptable, as no digits Aasdfasd12: not acceptable, as have uppercase character

3944


find level of following tree (state, parent) " J,D I,D H,C E,B F,B G,C B,A D,A C,A A,& K,E L,E L,F M,F N,G O,H P,I P,H Q,I R,J S,K U,P T,L

1997


how to write a program that opens a file and display in reverse order?

2558


Write a C/C++ program that connects to a MySQL server and displays the global TIMEZONE.

4567


Create a program to read two random data set in two files named data1.txt and data2.txt manifold contains integer numbers, whereas data2.txt file contains the float type numbers. Simpanlahmasing each into 2 pieces of data that is an array of type integer array and an array of type float, then calculate the average numbers in the second array.

2137






write a program using virtual function to find the transposing of a square matrix?

2832


output for printf("printf");

1974


write a program to perform generic sort in arrays?

2611


write a program to convert temperature from fa height into celcius and vise versa,use modular programming

2430


write a program that reverses the input number of n.Formulate an equation to come up with the answer.

7017


Write a simple encryption program using string function which apply the substitution method.

5527


Code for Two Classes for Doing Gzip in Memory?

2802


create a stucture student containing field for roll no,class,year and marks.create 10 student annd store them in a file

2207


write a program that can LOCATE and INSERT elements in array using c++ programming languages.

3423


Write a C++ program without using any loop (if, for, while etc) to print prime numbers from 1 to 100 and 100 to 1 (Do not use 200 print statements!!!)

3257