Write a client method called bubblesort which given a list


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)

Request for Solution File

Ask an Expert for Answer!!
Computer Engineering: Write a client method called bubblesort which given a list
Reference No:- TGS02911389

Expected delivery within 24 Hours