Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

1- Implement the following method: public static void removeAllVowels(BagInterface aBag) The method should remove all vowels (a, e, I, o, u, and y) from the

1- Implement the following method: public static void removeAllVowels(BagInterface aBag) The method should remove all vowels (a, e, I, o, u, and y) from the bag of characters aBag, while keeping the other characters in the bag.

: 2- Implement the following method: public static void replicateEachNode(Node aListOfNodes) The method receives as an argument a reference to the first node in the list aListOfNodes. The method should replicate each node in the list one time. For example, suppose that the list is: 1 -> 5 -> 3 ->2 After the invocation of replicateEachNode, the list should become: 1 -> 1 -> 5 -> 5 -> 3 -> 3 -> 2 -> 2 Keep the original order of the list elements. Use the class Node below: public class Node { private int data; private Node next; public Node(int data) { this(data,null); } public Node(int data, Node next) { this.data = data; this.next = next; } public int getData() { return data; } public Node getNext() { return next; } public void setData(int data) { this.data = data; }

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access with AI-Powered Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Students also viewed these Databases questions