Ask Question, Ask an Expert

+61-413 786 465

info@mywordsolution.com

Ask Computer Engineering Expert

Assignment

You are to compare two sorting algorithms and to compare two searching algorithms by running and collecting data on each. Your data for sorting and searching will be strings of 25 characters in length.

First Part:

The two sorts to compare are the Bubble Sort and the Selection Sort. You are to test your sorts against different set of strings. Each sort will sort six sets of data, 1000 strings, then 2000 strings, 3000, 4000, 5000 and 6000 strings. You will compare how well each sort did with the different data sizes and show results. I would like to see a plot of the results. A table format showing results will do. Use the ‘time' function and the ‘difftime' function to gather sort times.

Second Part:

The two searches to use for comparisons are the Linear Search and the Binary Search. You will search for 2000 random strings in the array of 6000 strings and compute the average number of probes needed to find a match. The target string will be a randomly selected string from the 6000 string's data set. You will select randomly 2000 strings for testing each search algorithm.

You are to generate 25 random characters for each string for your string data sets.

Hint:

char charset[52]; "a b c ... A B C ... Z";

string randomstr;

for ( i = 1; i <=25; i++ )

{ randomndx = rand() % 56;

randomstr = randomstr + charset[ randomndx ]; //concat char to string

}

Computer Engineering, Engineering

  • Category:- Computer Engineering
  • Reference No.:- M92054111
  • Price:- $40

Priced at Now at $40, Verified Solution

Have any Question?


Related Questions in Computer Engineering

Please discuss the followingas demand increased for these

Please discuss the following: As demand increased for these mortgage backed securities, lenders reacted by relaxing their approval standards to increase production. No longer were "all" borrowers required to document the ...

Suppose a machine has 16 registers and uses 24 bit memory

Suppose a machine has 16 registers and uses 24 bit memory addresses. The opcodes are 8 bits so that the instruction length is 32 bits. Register instructions can have two or three register operands (4 bits to name each re ...

Tablet recommendationpreparation imagine the following

Tablet Recommendation: Preparation Imagine the following scenario: A hospital has hired you as a consultant to recommend a tablet for their employees to use, with these parameters: The hospital provides wifi access to th ...

Question suppose you are given n positive integers to sort

Question : Suppose you are given n positive integers to sort on a special computer which has access to special memory containing p slots. The special memory supports storing a key-value pair (a, b) into the memory in O(1 ...

The contracts manager at a company needs to make a large

The contracts manager at a company needs to make a large legal document available to an overseas customer. However, she has some challenges: The document contains sensitive information; it is too large to send via e-mail ...

Suppose i am designing a personnel database for a

Suppose I am designing a personnel database for a university. The university has three types of personnel: students, staff, and faculty. Here are the characteristics of the three groups: -All three groups have a name and ...

Suppose you are a manager in the it department for the

Suppose you are a manager in the IT department for the government of a corrupt dictator, who has a collection of computers that need to be connected together to create a communication network for his spies. You are given ...

Question suppose a computer using set associative cache has

Question : Suppose a computer using set associative cache has 2^16 words of main memory and a cache of 128 blocks, and each cache block contains 8 words. Show steps, please type. a. If this cache is 2-way set associative ...

Suppose a 4 packets of a message each of size 10 mbit

Suppose a 4 packets of a message, each of size 10 Mbit arrive simultaneously at a switch preceding a transmission link of rate 5 Mbps connecting to the destination host. (a) What is the average queuing delay experienced ...

Answer the following questions suppose that multiplying two

Answer the following Questions : Suppose that multiplying two general n by n matrices takes 3 seconds on a given computer, if n = 1000. Estimate how much time it will take to compute the LU-decomposition of such a matrix ...

  • 4,153,160 Questions Asked
  • 13,132 Experts
  • 2,558,936 Questions Answered

Ask Experts for help!!

Looking for Assignment Help?

Start excelling in your Courses, Get help with Assignment

Write us your full requirement for evaluation and you will receive response within 20 minutes turnaround time.

Ask Now Help with Problems, Get a Best Answer

Why might a bank avoid the use of interest rate swaps even

Why might a bank avoid the use of interest rate swaps, even when the institution is exposed to significant interest rate

Describe the difference between zero coupon bonds and

Describe the difference between zero coupon bonds and coupon bonds. Under what conditions will a coupon bond sell at a p

Compute the present value of an annuity of 880 per year

Compute the present value of an annuity of $ 880 per year for 16 years, given a discount rate of 6 percent per annum. As

Compute the present value of an 1150 payment made in ten

Compute the present value of an $1,150 payment made in ten years when the discount rate is 12 percent. (Do not round int

Compute the present value of an annuity of 699 per year

Compute the present value of an annuity of $ 699 per year for 19 years, given a discount rate of 6 percent per annum. As