Sort the functions by increasing order of growth

Assignment Help Data Structure & Algorithms
Reference no: EM131388770

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: https://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

Reference no: EM131388770

Questions Cloud

Discuss about the integrity of national sovereignty : Discuss about the integrity of national sovereignty.
How some of the benefits of globalization have actually hurt : Describe how some of the benefits of globalization have actually hurt businesses whose products are widely integrated in international markets. Do you think globalization itself will sustain the problem of counterfeits?
Did tjx display a strategy in their response : MBA 635- Did TJX display a strategy in their response? Discuss how the timing of the response impacted stakeholders and the TJX corporate brand. Did TJX keep the needs of stakeholders a priority in their decision-making process in the case?
Discuss about the economic inequality : Write an 1300 words essay and use two articles to write it and I will provide two articles.
Sort the functions by increasing order of growth : Array A of size n contains all integers form 1 to (n+1) but one! 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
Explore the pumpkin papers the rosenberg trial transcript : Text Choices pick one: Explore the Pumpkin Papers, the Rosenberg Trial transcript, or transcripts of the HCUAA hearings-view or listen to them online. Read about these stories or see films to explain the period. What was life like in American then..
Recommend strategies for sustaining an organizational change : Recommend strategies for sustaining an organizational change. Explain how stakeholders are involved in and held accountable for the organizational change.
How does this level of distrust reflect the culture : Why do you believe that his assassination resulted in such a massive influx of various conspiracy theories? How does this level of distrust (due to the conspiracy theories) reflect the culture of the country during the 1960s?
Determine and explain what type of leader steve jobs was : Determine and explain what type of leader Steve Jobs was. Explain how his vision and values were reflected in his leadership style. Discuss how Steve Jobs used partnerships and collaboration.

Reviews

Write a Review

Data Structure & Algorithms Questions & Answers

  Decision tree to help someone

Create a decision tree to help someone determine what meal to buy at a fast food restaurant. The structure of your tree should be similar to the one on page 699.

  Design an adt for a two-color

Design an ADT for a two-color, double-stack ADT that consists of two stacks one "red" and one "blue" and has as its operations color-coded versions of the regular stack ADT operations.

  Analyze case asymptotic complexity of making interference

Analyze the worst-case asymptotic complexity of making an interference graph, for a program of size N (with at most N variables and at most N control-flow nodes).

  Adt description

Which of the following is not the part of ADT description? Which of the following is true about the characteristics of abstract data types

  Why are symbolic constants usually a better choice

Why are symbolic constants usually a better choice than literal constants? Why are const symbolic constants usually a better choice than #defined symbolic constants?

  How do a bubble sort in mips?

How do a bubble sort in MIPS?

  Write a function called maxsubsum that takes a matrix a

Write a function called maxsubsum that takes a matrix A as an input, computes the sum of elements in each of its submatrices, and finds the submatrix that has the maximum sum

  Research paper surveying a popular algorithm

This assignment consists of writing a research paper surveying a popular algorithm. Your paper must conform to the American Psychological Association (APA) writing style. Your paper must use reputable scholarly references

  Short discussion on the concept of cryptography

The answer gives the learner with a short discussion on the concept of cryptography and the different aspects and functions that are provided through using encryption.

  Normalized relations for a database

Suppose that a information communications network links a computer at corporate headquarters with a computer in each retail outlet. The chain includes fifty stores with an average of 75 workers per store.

  Evaluate algebraic expression by code with three-operand

Evaluate a short algebraic expression using code with three-operand instructions. The expression should have a minimum of three operands and 2 operators.

  Algorithm to minimize average difference between height

The problem is to assign each skier a ski to minimize the average difference between height of a skier and his/her ski. Give pseudocode and write its asymptotic running time.

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