HeapSort an array with constant space complexity O(1).
What is heap. Create maximum heap using built in function or using array list. Use any one method for creation max heap.
Implementation the following function using Binary Search trees
I. Create BST.
II. Deletion of BST.
III. Searching maximum and minimum value in BST.
Write the algorithm and pseudocode for finding the average of five(5) numbers.
Calculate the time complexity of the following program fragments.
(a) πππ (π = 1; π β€ π; π β = 2)
{ π₯=π₯+1 }
(b) πππ (π = 1; π β€ π; π + +)
πππ (π = 1; π β€ π; π = π β 2) {
....
....
}
] Write the algorithm of a program that reads the input line-by-line and count the number of lines. Program should terminate when end-of-file (EOF) is reached
Write the algorithm of a program that reads password from the user and then compare it with the original password stored in file. If the password matches, it should display you got 10 marks else it should print you have failed.
You have decided to enter a model boat race. You put your boat at the start line next to yourΒ
best friend Jillβs boat. Create a program to print out the distance that both of your boatsΒ
travelled given the speed your boat travels in (feet per minute), the speed that Jillβs boatΒ
travels and the number of minutes in the race.Β
Distance = speed * timeΒ
Use the following as your sample Data:Β
speedMe = 6.2Β
speedJill = 5.9Β
time = 2Β
distanceMe = speedMe * time = 6.2 * 2 = 12.4Β
distanceJill = speedJill * time = 5.9 * 2
Consider a set up that corresponds between alphabetic characters as follows
Assuming the encryption algorithm is C=11m+7 mod 26, where m is the
message and C is the ciphertext.
I. Encrypt the word βCYBERCRIMEβ
CR,10Marks
II. Derive the decryption algorithm