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

The performance of an algorithm can be determined in terms of its time and space complexity. Explain the difference between time complexity and space complexity and make a case for which is the most efficient method for determining the performance of an algorithm


calculate the total amount of money paid in by (n)number of student using flochart


Calculate the median and mode for the following data set: 

Data Set = 2, 9, 10, 4, 8, 4, 12 


 Calculate the mean for the following data set: 

Data Set = 2, 9, 10, 4, 8, 4, 12




Using flowcharts, write an algorithm to read 100 numbers and then display the sum.


 Design an algorithm and the corresponding flowchart for finding the sum of the numbers 2, 4, 6, 8, …, n


algorithm to read 100 numbers then display the largest.


Question 1 Given that the messages y1, y2, y3, y4, y5 with the corresponding probabilities 0.4, 0.2, 0.2, 0.1, and 0.1 a) Construct a binary code by using a Shannon Fano Algorithm to determine?

I. Code efficiency ii. Redundancy of the code iii. Code tree


Question 2 a) Consider a Huffman’s Algorithm that uses a variable-length encoding scheme to compress the original text: GOOD DAY to determine the following?

I. Code tree ii. Codeword iii. Average code length


Question 3 a) Write a short note on the following and state any two (2) practical examples under each? I. Impact printer ii. Non-impact printer b) What is the difference between Additive Color and Subtractive Color and two (2) examples under each?


Given the radius of the circle find its area. using pseodocode


Dynamic Programing - City Planning. A city planner is asked to organize grocery shops in a new city. The city has a straight line main street that goes throughout the city. The city planner is asked to position where should the city provide permits to build new grocery shops so that people of the new city can have the shortest distance to their grocery markets. The population density is not constant along both sides of the main street. A higher density is around multiple city centers or crossroads along side the main street.

Your task is to develop an algorithm, given the positions of the city centers and the number of grocery shops, computes the least possible sum of all distances between each city centers and its nearest grocery shop.

Input to your Algorithm:

  1. List of city centers coordinate positions along the main street (each an integer number
  2. between 1 and 1000). This is a sequence of numbers.
  3. Number of city centers is an integer between 2 and 100.
  4. Number of grocery shops (an integer number between 2 and 30).
  5. The number of shops is smaller than the number of city centers.

Output of your algorithm: A single integer, which is the sum of all distances between each city center and its nearest grocery market.

Sample Input:

5

[1 2 3 6 7 9 11 21 40 50]

Sample Output:

9

Figure 1: A visualization of City Center Positions and Grocery Shops. (Numbers in grocery shop row is the distance to the nearest shop. )

Tasks:

  • Task 2.1. What are the sub-problems in this case? What is the counts of sub-problems? Provide a brief description of your solution.
  • Task 2.2. Write up your algorithm in Pseudocode or python implementation.
  • Task 2.3. What is the run time complexity of your algorithm?




LATEST TUTORIALS
New on Blog
APPROVED BY CLIENTS