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 / jeya
in tree the left most elemt is minimum element.the right
most element is max element.
| Is This Answer Correct ? | 4 Yes | 7 No |
Post New Answer View All Answers
Question 1: Implement a base class Appointment and derived classes Onetime, Daily, Weekly, and Monthly. An appointment has a description (for example, “see the dentist”) and a date and time. Write a virtual function occurs_on(int year, int month, int day) that checks whether the appointment occurs on that date. For example, for a monthly appointment, you must check whether the day of the month matches. Then fill a vector of Appointment* with a mixture of appointments. Have the user enter a date and print out all appointments that happen on that date. *This Should Be Done IN C++
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)
write a program to convert temperature from fa height into celcius and vise versa,use modular programming
write a function that allocates memory for a single data type passed as a parameter.the function uses the new operator and return a pointer to the allocated memory.the function must catch and handle any exception during allocation
create a stucture student containing field for roll no,class,year and marks.create 10 student annd store them in a file
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
can you please write a program for deadlock that can detect deadlock and to prevent deadlock.
write a function that reverse the elements of an array in place.The function must accept only one pointer value and return void.
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
Code for Two Classes for Doing Gzip in Memory?
develop a program to calculate and print body mass index for 200 employees
write a program to perform generic sort in arrays?
Code for Small C++ Class to Transform Any Static Control into a Hyperlink Control?
Write a simple encryption program using string function which apply the substitution method.
Write a C/C++ program that connects to a MySQL server and displays the global TIMEZONE.