Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

a. Implement an instance method in IntLinkedBag, called split, that returns two linked lists as output (i.e., return data type is IntNode []) where

a. Implement an instance method in IntLinkedBag, called split, that returns two linked lists as output (i.e., return data type is IntNode []) where the first linked list include all the odd numbers in the bag while the second linked list include all the even number in the bag. For example, if the bag includes the following numbers [1,2,3,4,5,6], then the output lists will be as follows: a. Odds list [1,3,5] b. Evens list [2,4,6] 2 b. Write code in the driver to test your split method on the bag, called b, that is created in Exercise 1. To make sure the method works as expected, print the contents of the output lists. c. Implement another instance method in IntLinkedBag, called splitv2, that is similar to split but returns two IntLinkedBag instead of two IntNode as output. d. Write code in the driver to test your splitV2 method on the bag, called b, that is created in Exercise 1. To test the method, print the contents of the output bags.

Step by Step Solution

3.46 Rating (149 Votes )

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

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

Step: 2

blur-text-image_2

Step: 3

blur-text-image_3

Document Format ( 2 attachments)

PDF file Icon
663d520c92cc7_968035.pdf

180 KBs PDF File

Word file Icon
663d520c92cc7_968035.docx

120 KBs Word File

Ace Your Homework with AI

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

Get Started

Recommended Textbook for

Auditing and Assurance services an integrated approach

Authors: Alvin a. arens, Randal j. elder, Mark s. Beasley

14th Edition

133081605, 132575957, 9780133081602, 978-0132575959

More Books

Students also viewed these Programming questions