Database System Concepts
Database System Concepts
7th Edition
ISBN: 9780078022159
Author: Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher: McGraw-Hill Education
Bartleby Related Questions Icon

Related questions

Question

PART A:

Note: The following code is written only in main -- you assume there is an array bag and you are not adding any methods to that bag.

Write the main program to create two array bags of type string. Place 5 strings of your choice in the first bag and 5 strings (of your choice) in the second bag.  Your program must:
1) determine if there are any strings in the first bag that appears in the second bag as well. If there are, print there are repeated strings. Else print the bags have unique values.

2) Print the content of the both bags and if there are repeated values, print that value only once.

 

PART B:

Create two linkedBag objects of type string in main. Place 5 strings in the first bag and five strings in the second bag. Then your code must test if the two linkedBag objects are equal or not. You must traverse both linkedBags and test each items to see if they are the same.

Then you must display a message saying the two linkedBags are the same or different.

 

PART C:

Write a method in the linkedBag class that gets an item of type T and finds out how many of the items in the linkedBag are bigger than that item. Return that count.

Expert Solution
Check Mark
Knowledge Booster
Background pattern image
Similar questions
Recommended textbooks for you
Text book image
Database System Concepts
Computer Science
ISBN:9780078022159
Author:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:McGraw-Hill Education
Text book image
Starting Out with Python (4th Edition)
Computer Science
ISBN:9780134444321
Author:Tony Gaddis
Publisher:PEARSON
Text book image
Digital Fundamentals (11th Edition)
Computer Science
ISBN:9780132737968
Author:Thomas L. Floyd
Publisher:PEARSON
Text book image
C How to Program (8th Edition)
Computer Science
ISBN:9780133976892
Author:Paul J. Deitel, Harvey Deitel
Publisher:PEARSON
Text book image
Database Systems: Design, Implementation, & Manag...
Computer Science
ISBN:9781337627900
Author:Carlos Coronel, Steven Morris
Publisher:Cengage Learning
Text book image
Programmable Logic Controllers
Computer Science
ISBN:9780073373843
Author:Frank D. Petruzella
Publisher:McGraw-Hill Education