Complexity T(n)
Write a linear-time algorithm that sorts n distinct
integers, each of which is between 1 and 500.
Hint: Use a 500-element array. (Linear-time means your
algorithm runs in time c*n + b, where c and b are any
constants that do not depend on n.
For example, your algorithm can run in time n, or time 2n +
1, or time 5n + 10, or time 100n + 6, but not time c*n*n =
c*n?.)
Write a program that print in screen a tree with its height taken from user by entering number of 4 digits and find the odd numbers then calculate the sum of odd numbers so he get the height of tree?
A string of charaters were given. Find the highest occurance of a character and display that character. eg.: INPUT: AEGBCNAVNEETGUPTAEDAGPE OUTPUT: E
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
Complexity T(n) Write a linear-time algorithm that sorts n distinct integers, each of which is between 1 and 500. Hint: Use a 500-element array. (Linear-time means your algorithm runs in time c*n + b, where c and b are any constants that do not depend on n. For example, your algorithm can run in time n, or time 2n + 1, or time 5n + 10, or time 100n + 6, but not time c*n*n = c*n?.)
write a c program, using for loop, that accepts and odds two numbers. The output must be the sum and the addens. This should be repeated 5 times while the first number is decremented by one and the second number is incremented by 1.
write a program that reads a series of strings and prints only those strings begging with letter "b"
write a program to convert temperature from fa height into celcius and vise versa,use modular programming
0 Answers Jomo Kenyatta University,
write a program that calculate the volume of cylinder after user enters radius and height and show the algorithm used
1 Answers Jomo Kenyatta University,
Write a program that takes a 3 digit number n and finds out whether the number 2^n + 1 is prime, or if it is not prime find out its factors.
Given 1 to n random number, find top 10 maximum numbers and explain the time complexity of the algorithm.
what is the use of using for loop as "for(;;)"?
Ask the user to input three positive integers M, N and q. Make the 2 dimensional array of integers with size MxN, where all the elements of I (I = 1,…,M) line will be members of geometrical progression with first element equal to the number of line (I) and denominator q.