Ask Computer Engineering Expert

1 Coursework Specification

Your assignment is to study the performance of operations on an Abstract Data Type, based on numerical data generated from your UoB number. Use an existing random number generator1 that will create collections of 100 integer keys, with values in the range [0, N], where N is your UoB number. You will run your algorithm in the following cases:

1. K = 10 times;
2. K = 100 times;
3. K = 1, 000 times;
and will report for each case the average execution time2 calculated as the number of operations S divided by K.

Submission Guidelines

Your submission must be a zip archive containing plain text (.txt, .java) and pdf files uploaded to the module's Blackboard assessment section. The name of your zip archive must be your UoB number. The content of your submitted files must be as follows.

1. The results file which is a plain text file titled results.txt that has
- Your UoB number in the first line.
- One section from:
- Hash Table Insertion with Linear Probing
- Hash Table Insertion with Secondary Hash
- Binary Search Tree Insertion as detailed below.

2. Your full running code (Java files) that implements your results.

3. Your comments of up to 2 pages on how your results compare with the published time complexity of the chosen algorithm. This will include results from executing your program, knowledge of expected execution time, critical review and discussion of the results, making use of references, tables and/or graphical representations. This will be submitted as a pdf file titled comments.pdf.
4. Nothing else! For example, although you might well find it convenient to draw the various trees as you construct them, do not include such diagrams in your submission.

3 The ADTs
Hash Table Insertion with Linear Probing
The task here is to show, and count, the trace of operations needed to insert the randomly generated keys, one by one, into an initially empty 101-bucket hash table with:
- (primary) hash function h1(x) = x mod 101
- using linear probing for collision resolution.
Your Java code should keep count of the number S of hash table operations, and the average execution time for each case S/K should be printed out. The hash table operations are coded as follows:
- Pn to probe bucket n (to see if it already contains an entry);
- Ixx@n to insert key xx into bucket n;

Your results.txt file should have the coded operations in sequence, e.g. if the first 3 values to be inserted are
15012340, 250, 306 the results.txt file would start:
15012345
Hash Table Linear Probing 1) K=10
P3 I15012340@3 P48 I250@48 P3 P4 I306@4 ...
Number of steps required S=150
Average number of steps per key: 150/100=1.5

2) K=100
...
Note that you only need to print out the sequence of operations once!

Hash Table Insertion with Secondary Hash
The task here is the same as Hash Table Insertion with Linear Probing except that collision resolution is performed by using the secondary hash function h2(x) = (x mod 5) + 1 to calculate the increment from the collision index. Your results.txt file should include the section heading
Hash Table: Secondary Hash
Your Java code should keep count of the number S of hash table operations, and the average execution time for each case S/K should be printed out. The hash table operations are coded as follows:
- Pn to probe bucket n (to see if it already contains an entry);
- Ixx@n to insert key xx into bucket n;
Your results.txt file should have the coded operations in sequence, e.g. if the first 3 values to be inserted are
15012340, 250, 306 the results.txt file would start:
15012345
Hash Table Linear Probing 1) K=10
P3 I15012340@3 P48 I250@48 P3 P4 I306@4 ...
Number of steps required S=150
Average number of steps per key: 150/100=1.5

2) K=100
...
Note that you only need to print out the sequence of operations once!

Binary Search Tree Insertion
The task here is to show, and count, the trace of operations needed to insert the K randomly generated keys, one by one, into an initially empty binary search tree.
Your Java code should keep count of the number S of binary search tree operations, and the average execution time for each case S/K should be printed out. The binary search tree operations are coded as follows:
1. Txx insert key xx as the tree root;
2. Lxx@yy go left at the node with key yy (new key value xx is less than current node key yy);
3. Rxx&yy go right at the node with key yy (new key value xx is more than current node key xx);
4. Ixx@yy insert key xx as the child of the node with key yy.
Your results.txt file should have the coded operations in sequence, e.g. if the first 3 values to be inserted are
15012340, 250, 306 the results.txt file would start:
15012345
Binary Search Tree Insertion 1) K=10
T15012340 L250@15012340 I250@15012340 L306@15012340 R306@250 I306@250 ...
Number of steps required S=45
Average number of steps per key: 45/10=4.5

Computer Engineering, Engineering

  • Category:- Computer Engineering
  • Reference No.:- M92809309
  • Price:- $145

Guranteed 48 Hours Delivery, In Price:- $145

Have any Question?


Related Questions in Computer Engineering

Does bmw have a guided missile corporate culture and

Does BMW have a guided missile corporate culture, and incubator corporate culture, a family corporate culture, or an Eiffel tower corporate culture?

Rebecca borrows 10000 at 18 compounded annually she pays

Rebecca borrows $10,000 at 18% compounded annually. She pays off the loan over a 5-year period with annual payments, starting at year 1. Each successive payment is $700 greater than the previous payment. (a) How much was ...

Jeff decides to start saving some money from this upcoming

Jeff decides to start saving some money from this upcoming month onwards. He decides to save only $500 at first, but each month he will increase the amount invested by $100. He will do it for 60 months (including the fir ...

Suppose you make 30 annual investments in a fund that pays

Suppose you make 30 annual investments in a fund that pays 6% compounded annually. If your first deposit is $7,500 and each successive deposit is 6% greater than the preceding deposit, how much will be in the fund immedi ...

Question -under what circumstances is it ethical if ever to

Question :- Under what circumstances is it ethical, if ever, to use consumer information in marketing research? Explain why you consider it ethical or unethical.

What are the differences between four types of economics

What are the differences between four types of economics evaluations and their differences with other two (budget impact analysis (BIA) and cost of illness (COI) studies)?

What type of economic system does norway have explain some

What type of economic system does Norway have? Explain some of the benefits of this system to the country and some of the drawbacks,

Among the who imf and wto which of these governmental

Among the WHO, IMF, and WTO, which of these governmental institutions do you feel has most profoundly shaped healthcare outcomes in low-income countries and why? Please support your reasons with examples and research/doc ...

A real estate developer will build two different types of

A real estate developer will build two different types of apartments in a residential area: one- bedroom apartments and two-bedroom apartments. In addition, the developer will build either a swimming pool or a tennis cou ...

Question what some of the reasons that evolutionary models

Question : What some of the reasons that evolutionary models are considered by many to be the best approach to software development. The response must be typed, single spaced, must be in times new roman font (size 12) an ...

  • 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