Compare two sorting and two searching algorithms

Assignment Help Data Structure & Algorithms
Reference no: EM131299463

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

}

Reference no: EM131299463

Questions Cloud

Identify the errors in the php code provided : Identify the errors in the PHP code provided for you in assignment6.php (Download ZIP). Correct the code and create comments explaining why the original code would not work properly.
Lifetime budget constraint of the consumer : 1) Write down the lifetime budget constraint of the consumer. 2) Show that lifetime wealth is the same for the consumer, before and after the change in tax rates.
Why the teller application can call the withdraw methods : Explain why the Teller application can call the withdraw and deposit methods using a SavingsAccount object reference, even though we did not define these methods.
Lemons problem in terms of financial instruments : Explain the lemons problem in terms of financial instruments and the role of financial intermediaries in reducing this problem. Don't use the automobile reference in answering this question.
Compare two sorting and two searching algorithms : 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.
What is the covariance between hp and the market : (a) What is the covariance between HP and the market? (b) What is HP's beta? (c) What is the expected return of HP? (d) What percent of HP's total risk (variance) is idiosyncratic?
Estimate the drying rate per unit width of the garment : The garment may be assumed to have a temperature of 25°C and a characteristic length of 1 m in the vertical direction. Estimate the drying rate per unit width of the garment.
What is the velocity of the ball in frame s : An observer is sitting in frame S at rest with respect to S. A second person is sitting in frame S' which is moving with β = 0.8 away from S. What is the velocity of the ball in frame S
Calculate the water evaporation rate on a daily basis : Calculate the total heat loss from the surface, and compare the relative contributions of the sensible, latent, and radiative effects. Review the assumptions made in your analysis, especially those relating to the heat and mass transfer analogy.

Reviews

Write a Review

Data Structure & Algorithms Questions & Answers

  Write a program to find average marks

Write a program to find average marks obtained by 10 students in a test along with algorithm and write a menu driven program using function to perform following operations on 1 d array?

  Calculate the number of disk tracks traversed using the fcfs

Calculate the number of disk tracks traversed using the FCFS, SSTF, SCAN, and LOOK algorithms for the series of disk track service requests given below.

  Write a program to implement a linear linked list

Write a C/C++ program to implement a singly linear Linked List

  Create algorithm-smallest element-set of combined elements

Assume that X and Y are two sorted sequences, comprising m and n elements respectively. Create the algorithm to nd kth smallest element in set of m + n combined elements.

  Write algorithm to decide which commute is cheaper

Write working algorithm in pseudo code to decide which commute is cheaper: You wish to decide whether you must drive your car to work or take train. You know one-way distance

  Determine the sequence of pairwise matrix multiplication

Determine the sequence of pairwise matrix multiplication to use. Show the steps of the algorithm - Bellman-Ford algorithm on this graph. Show the steps of the algorithm.

  Draw a structured flowchart or write pseudocode

Draw a structured flowchart or write pseudocode that describes the process of looking up a word in a dictionary. Pick a word at random and have a fellow student attempt to carry out your instructions.

  find the minimum and maximum values in s

Given an array s =(s[1], s[2], . . . , s[n]), and n = 2^d for some d = 1. We want to find the minimum and maximum values in s. We do this by comparing elements of s.

  Explain the three types of relationships

Provide an example of a one to one relationship and an example of a many-to-many relationship in a newspaper, magazine, book, or everyday situation you encounter.

  Write a c program to find the intersection andor union of

write a c program to find the intersection andor union of two doubly linked lists using recursion. you are not allowed

  Creating flowchart to compute and print the total sale

A coorporation's salesman are selling toothpaste and tooth powder. The corporation having fifty salesman gives 10% commission on the sale of toothpaste and 20 percent commission on tooth powder.

  Writing the opeartors which contains the states

I want help with writing the opeartors which contains the states includiing its precondition and action for the eight queens problem. that is placing 8 pieces (the queens) on an 8 by 8 chess board. i want the code to be as basic and uncomplicated ..

Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd