Questions: 856

Answers by our Experts: 763

Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!

Search & Filtering

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.


  1. Using a flowchart or pseudocode,Β design logic for the following:Β The South African Association for Retired Persons (SARP) mails out applications to people who are age 50 and older. How might you write a selection question to select all persons eligible for SARP? Age is a variable.

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


LATEST TUTORIALS
New on Blog
APPROVED BY CLIENTS