Question
Task 2: Write a java program to iterate through all elements in the TreeSet using iterators and print them. Task 3: Write a program to
Task 2: Write a java program to iterate through all elements in the TreeSet using iterators and print them.
Task 3: Write a program to perform the following task: 1. Print the set in descending order 2. Print the elements greater than and less than the given element. (use a dynamic approach. Sample input: 200) 3. find the class to which the given list belongs. 4. Find the subset within the given range.(use a dynamic approach. Sample input: 200 - 700)
Task 4: Explain the features of TreeSet
Task 5: For the given data set depict the TreeSet traversal. (Note: For Task 5, perform the traversal in a sheet and upload the image of it)
Input List of data: 100, 50, 125, 175, 45, 225, 500, 25, 75, 15, 150, 5
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started