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

  Mathematics in computing

Binary search tree, and postorder and preorder traversal Determine the shortest path in Graph

  Ict governance

ICT is defined as the term of Information and communication technologies, it is diverse set of technical tools and resources used by the government agencies to communicate and produce, circulate, store, and manage all information.

  Implementation of memory management

Assignment covers the following eight topics and explore the implementation of memory management, processes and threads.

  Realize business and organizational data storage

Realize business and organizational data storage and fast access times are much more important than they have ever been. Compare and contrast magnetic tapes, magnetic disks, optical discs

  What is the protocol overhead

What are the advantages of using a compiled language over an interpreted one? Under what circumstances would you select to use an interpreted language?

  Implementation of memory management

Paper describes about memory management. How memory is used in executing programs and its critical support for applications.

  Define open and closed loop control systems

Define open and closed loop cotrol systems.Explain difference between time varying and time invariant control system wth suitable example.

  Prepare a proposal to deploy windows server

Prepare a proposal to deploy Windows Server onto an existing network based on the provided scenario.

  Security policy document project

Analyze security requirements and develop a security policy

  Write a procedure that produces independent stack objects

Write a procedure (make-stack) that produces independent stack objects, using a message-passing style, e.g.

  Define a suitable functional unit

Define a suitable functional unit for a comparative study between two different types of paint.

  Calculate yield to maturity and bond prices

Calculate yield to maturity (YTM) and bond prices

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