Write a client method called bubblesort

Assignment Help Computer Engineering
Reference no: EM132117935

Queues, Lists, and Stacks Assignment:

Write client methods to do the following

Assume that there exists in main a list declared as :

List<Integer> aList = new List<Integer>(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<Integer> list1, int position1, int position2)

The heading for the method should be:

public static void bubbleSort( List<Integer> list1)

Assume that in main there exists a queue declared as:

Queue<String> aQueue = new Queue<String>(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<String> q1, String word)

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

Queue<String> aQueue = new Queue<String>(50);

Queue<String> bQueue = new Q<String>(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<String> concat( Queue<String> q1, Queue<String> q2)

Assuming that in main there exists a Stack declared as:

Stack<Integer> aStack = new Stack<Integer>(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<Integer> s1)

Assuming that in main there exists a Stack declared as:

Stack<Integer> aStack = new Stack<Integer>(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<Integer> s1)

Reference no: EM132117935

Questions Cloud

Constitutional interpretation has changed over time : Describe the process of amending the Constitution and the informal ways in which Constitutional interpretation has changed over time.
Effective annual return of 8 percent : At the end of this investment period, you will have how much if you earn an effective annual return of 8 percent.
Create a boxplot of high temperature using month : Create a boxplot of ‘high temperature' using ‘month' as a factor variable.
How the appreciation of global exchange rates : How the appreciation of global exchange rates and the potential increase in US short term interest rates may affect world economic stability and its impact?
Write a client method called bubblesort : 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.
What is the meaning of capital structure : What is the meaning of capital structure and how do i define the differences of capital structure?
Identify actual examples of uses in the current market : COIT20249 - draft a report with some recommendations for the next Executive Management meeting - Your report must identify actual examples
Write a program that implements the queue : As customers arrive they are given a ticket number. When a customer service agent is free the customer with the next ticket number is called.
Sources to fund the expected growth : What amount of additional funds will Wall-E need from external sources to fund the expected growth?

Reviews

Write a Review

Computer Engineering Questions & Answers

  Difference between von neumann and harvard cpu architectures

What is the difference between von Neumann and Harvard CPU architectures? Provide an example of a commercially available microcontroller using each type of CPU.

  Show how to find out such a seating arrangement

Show how to find out such a seating arrangement and prove that no such seating plan is possible.

  Wap that reads an arbitrary number of even integers

Write a program that reads an arbitrary number of even integers that are in the range 2 to 100 inclusive and counts how many occurrences of each are entered.

  Write your mini-security policy

Write your mini-security policy following the template in textbook addressing the three issues you identified.

  Article on a biomedical application using a microcontroller

Find a recent article on a biomedical application using a microcontroller and how you would design this microcontroller-based string matching detector. Which peripherals would you be using? What considerations would you take into account

  What profit do you see with partitioned view

Explain your idea for a database along with your thoughts for a partitioned view. 1. How will you use this partitioned view?

  Design and implementation of demonstration system

ICT705 - Data and System Integration - University of the Sunshine Coast - You are required to write a report explaining the key concepts around the design

  Write down english narrative that converts currency

Using the C compiler, write down a C program that contains your narrative from broken down into one line sentences, that have been commented out.

  Creation of incident timelines and investigatory scope

In this first phase of the incident response process the incident response team must perform an incident review. Describe in detail each item below as part.

  What would happen if the data were not normalized

What would happen if the data were not normalized? se k-means clustering with the number of clusters that you found above. Does the same picture emerge?

  Write a program that creates a number grid

Write a program that creates a number grid based on user input. A number grid is a sequence of integers organized into rows and columns.

  How various 8-letters password are possible

Repeat steps 1 and 2 using an encryption alphabet that includes 26 uppercase letters, 26 lowercase letters, and digit 0 through 9.

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