Ask Question, Ask an Expert

+61-413 786 465

info@mywordsolution.com

Ask Computer Engineering Expert

Java Data strcutres and Algorithm Assignment

Question 1: Java Programming Project: On-line Message Assembler

When Bob wants to send Alice a message (M) on the Internet, he breaks M into n data packets, numbers the packets consecutively, and injects them into the network. When the packets arrive at Alice's computer, they are out of order, so Alice must sort the sequence of n packets in order before she is able to read the entire message.

You are asked to create a Java program, which would help Alice assemble Bob's messages. You can assume that for each message (M), the contents of n received packets, together with their respective sequence numbers, are temporarily stored in a file, as illustrated in Figure 1. An example of such a file, which can be used for test purposes, is available at: http://www.cs.yorku.ca/course/2011/Mystery.txt

2443_Figure.png

Your program design should be based on the following guidelines:

(1) Create DLLNode_class, which will be used to store the content of each individual packet.

(2) Create DLL class, which will be used to store the content of an entire file (i.e. message) - one line/packet per node. The outline of this class is given below. You are allowed to add new methods to this class, as needed.

(3) Create MessageAssembler class, which will contain main() method and act as a tester class. The outline of this class is given below. You are allowed to add new methods to this class, as needed.

Question 2: Algorithm Design

Array A of size n contains all integers form 1 to (n+1) but one!

1) Assuming the array is sorted, propose a (best-running time) algorithm that finds/identifies the missing number, and analyze its worst-case running time in terms of big-O notation.

2) Assuming the array is NOT sorted, propose a (best-running time) algorithm that finds/identifies the missing number and analyze its worst-case running time in terms of big O notation.

Question 3: ADTs / Stacks

Using the regular Stack ADT, design an advanced Stack ADT for which getMinimum() method runs in O(1) time. Pushing and popping n elements to this Stack should each run in O(n) (i.e., you are not allowed to perform any sorting (e.g.) as a part of a different method). You are only allowed to use one additional data structures (e.g., another Stack) in your design.

Describe your solution in words and provide a brief pseudocode for the new push(), pop(), and getMinimum() methods.

Question 4: Big-O Analysis

Sort the following functions by increasing order of growth:

nlg n      nlg n         (lg n)n    2lg n/2      n2           

Question 5: Running Time Analysis

Express the running time of the following program segment using big-θ notation. Show/justify your work.

Attachment:- Assignment Files.rar

Computer Engineering, Engineering

  • Category:- Computer Engineering
  • Reference No.:- M92198591
  • Price:- $95

Guranteed 48 Hours Delivery, In Price:- $95

Have any Question?


Related Questions in Computer Engineering

A researcher working at a particular company wants to know

A researcher working at a particular company wants to know if workers' health would improve if they were given extra days 'off. In this company, all workers undergo a standard physical exam twice a year and after each ex ...

Xl cos dividends are expected to grow at a 20 rate for the

XL Co.'s dividends are expected to grow at a 20% rate for the next 3 years, with the growth rate falling off to a constant 6% thereafter. If the required return is 14% and the company just paid a $3.10 dividend, what is ...

How could legislation impact on operations within your

How could legislation impact on operations within your organisation in relation to innovation, project management, and operational planning? Briefly outline any relevant requirements (e.g. intellectual property, WHS).

Give examples of how dominos has adapted its global

Give examples of how Domino's has adapted its global marketing mix to meet the needs of local consumers. Are you their customer? If so, why?

With regards to data mining business analytics why is it

With regards to data mining/ business analytics, Why is it not ideal to evaluate a classifier's performance on the training data set?

1 what is the boolean expression for an and gate2 what is

1. What is the Boolean expression for an AND gate? 2. What is the Boolean expression for an OR gate? 3. What is the Boolean expression for a NOT gate?

Question sinksort is a f times n which helps sort

Question : Sinksort () is a f times n which helps sort sequences, in order to do so it makes switches (adjacent doubleheadarrow). Write a function which sorts a given sequence from smallest to largest.

How to design a java program that reads a sentence say s

How to design a Java program that reads a sentence, say s, consisting of lower-case words with .nextLine() method, identifies the words using .indexOf() and .substring() methods and saves them in String variables. Then t ...

The system development team at the xyz company is working

The system development team at the XYZ Company is working on developing a new customer order entry system. In the process of designing the new system, the team has identified the following data entity attributes: Invento ...

Assume that the hypothetical economy of mo has 8 workers in

Assume that the hypothetical economy of Mo has 8 workers in year 1, each working 1,500 hours per year (50 weeks at 30 hours per week). The total input of labor is 12,000 hours. Productivity (average real output per hour ...

  • 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