Ask Question, Ask an Expert

+61-413 786 465

info@mywordsolution.com

Ask Computer Engineering Expert

Queues, Lists, and Stacks Assignment:

Write client methods to do the following

Assume that there exists in main a list declared as :

List aList = new List(50);

Write a client method called bubbleSort which given a list as a parameter uses the bubble sort algorithm to sort the contents of the list.

YOU MAY ASSUME that there exists a method called swap (with the following signature) which swaps the contents of two elements:

// swap

public static void swap(List list1, int position1, int position2)

The heading for the method should be:

public static void bubbleSort( List list1)

Assume that in main there exists a queue declared as:

Queue aQueue = new Queue(50);

Write a client method called removeAll that given a String as a parameter removes all occurrences of the String from the queue, leaving the other values in the queue.

The heading for the method should be:

public static void removeAll(Queue q1, String word)

Assume that in main there exists 2 queue's declared as:

Queue aQueue = new Queue(50);

Queue bQueue = new Q(50);

Write a client method called concatenate that concatenates two queues together and creating and returning a new queue.

the heading should be

public static Queue concat( Queue q1, Queue q2)

Assuming that in main there exists a Stack declared as:

Stack aStack = new Stack(50);

Write a client method called reverseStack that given a stack as a parameter, reverses the contents of the stack. In this method you can declare additional instances of queues and stacks as needed.

Its heading should be:

public static void reverseStack(Stack s1)

Assuming that in main there exists a Stack declared as:

Stack aStack = new Stack(50);

Write a client method called getLast that given a stack as a parameter, returns the value on the bottom of the stack, leaving the stack unchanged when the method is finished. In this method you can declare additional instances of queues and stacks as needed.

Its heading should be:

public static int getLast(Stack s1)

Computer Engineering, Engineering

  • Category:- Computer Engineering
  • Reference No.:- M93105403

Have any Question?


Related Questions in Computer Engineering

Aa stock will pay dividends of 3 4 and 9 over the next

aA stock will pay dividends of $3, $4, and $9 over the next three years, and then increase dividends at a rate of 3% afterwards. Its required rate of return is 15%. What is the value of the stock? Round to the penny.

What is the relation between z-score confidence interval

What is the relation between Z-score, confidence interval, t-statistic, p-score and hypothesis testing?

Question initial post respond to each prompt below1describe

Question: Initial Post: Respond to each prompt below. 1. Describe one hardware component that are essential to YOU as a consumer. Provide three options (brand, style, etc.) for the component. 2. Offer two new or interest ...

Discussion 2 initial post due friday by midnight estdefine

Discussion 2: Initial post due Friday by midnight EST Define and briefly discuss the following brainstorming techniques, the delphi technique, brainstorming, or nominal group technique. For your discussion, you are requi ...

Systems analysis projectpersonal trainer inc owns and

Systems analysis project Personal Trainer, Inc. owns and operates fitness centers in a dozen Midwestern cities. The centers have done well, and the company is planning an international expansion by opening a new "superce ...

In a standard s - t maximum flow problem we assume edges

In a standard s - t maximum flow problem, we assume edges have capacities, and there is no limit on how much flow is allowed to flow through a node. In this problem, we consider the variant of the maximum flow and minimu ...

Question suppose you are designing a database for a library

Question : Suppose you are designing a database for a library, the library system contains information about people who borrow. Each person is uniquely identified. People can search and borrow books. A book has book ID. ...

As noted in chapter 14 of aampa distribution of income

As noted in Chapter 14 of A&A, distribution of income among various population groups followed roughly the same patterns in the USA, Sweden, and the former Soviet Union, despite the very different forms of economic organ ...

What does it mean when a bank has lower derivative assets

What does it mean when a bank has lower derivative assets than derivative liabilities on foreign exchange related contracts and vice-versa? What implications does this have with foreign exchange risk for the bank?

An important decision places christmas holiday celebrators

An important decision places Christmas holiday celebrators: To buy real or artificial trees? A market research firm reported that 62% of individuals polled preferred an artificial tree. We conduct independent serving of ...

  • 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