Collection Framework

 Linked List:

1. Write a   program to append the specified element to the end of a linked list.  

2. Write a   program to iterate through all elements in a linked list.  

3. Write a   program to iterate through all elements in a linked list starting at the specified position.  

4. Write a   program to iterate a linked list in reverse order.  

5. Write a   program to insert the specified element at the specified position in the linked list.  

6. Write a   program to insert elements into the linked list at the first and last position.  

7. Write a   program to insert the specified element at the front of a linked list.  

8. Write a   program to insert the specified element at the end of a linked list.  

9. Write a   program to insert some elements at the specified position into a linked list.  

10.Write a   program to get the first and last occurrence of the specified elements in a linked list.  

11.Write a   program to display the elements and their positions in a linked list.  

12.Write a   program to remove a specified element from a linked list.  

13.Write a   program to remove first and last element from a linked list.  

14.Write a   program to remove all the elements from a linked list.  

15.Write a   program of swap two elements in an linked list.  

16.Write a   program to shuffle the elements in a linked list.  

17.Write a   program to join two linked lists.  

18.Write a   program to clone an linked list to another linked list.  

19.Write a   program to remove and return the first element of a linked list.  

20.Write a   program to retrieve but does not remove, the first element of a linked list.  

21.Write a   program to retrieve but does not remove, the last element of a linked list.  

22.Write a   program to check if a particular element exists in a linked list.  

23.Write a   program to convert a linked list to array list.  

24.Write a   program to compare two linked lists.  

25.Write a   program to test an linked list is empty or not.  

26.Write a   program to replace an element in a linked list.  

Hash Set :

1. Write a   program to append the specified element to the end of a hash set.  

2. Write a   program to iterate through all elements in a hash list.  

3. Write a   program to get the number of elements in a hash set.  

4. Write a   program to empty an hash set.  

5. Write a   program to test a hash set is empty or not.  

6. Write a   program to clone a hash set to another hash set.  

7. Write a   program to convert a hash set to an array.  

8. Write a   program to convert a hash set to a tree set.  

9. Write a   program to convert a hash set to a List/ArrayList.  

10. Write a   program to compare two hash set.  

11. Write a   program to compare two sets and retain elements which are same on both sets.  

12. Write a   program to remove all of the elements from a hash set.  

Tree Set :

1. Write a   program to create a new tree set, add some colors (string) and print out the tree set.  

2. Write a   program to iterate through all elements in a tree set.  

3. Write a   program to add all the elements of a specified tree set to another tree set.  

4. Write a   program to create a reverse order view of the elements contained in a given tree set.  

5. Write a   program to get the first and last elements in a tree set.  

6. Write a   program to clone a tree set list to another tree set.  

7. Write a   program to get the number of elements in a tree set.  

8. Write a   program to compare two tree sets.  

9. Write a   program to find the numbers less than 7 in a tree set.  

10. Write a   program to get the element in a tree set which is greater than or equal to the given element.  

11. Write a   program to get the element in a tree set which is less than or equal to the given element.  

12. Write a   program to get the element in a tree set which is strictly greater than or equal to the given element.  

13. Write a   program to get an element in a tree set which is strictly less than the given element.  

14. Write a   program to retrieve and remove the first element of a tree set.  

15. Write a   program to retrieve and remove the last element of a tree set.  

16. Write a   program to remove a given element from a tree set.  

priority queue :

1. Write a   program to create a new priority queue, add some colors (string) and print out the elements of the priority queue.  

2. Write a   program to iterate through all elements in priority queue.  

3. Write a   program to add all the elements of a priority queue to another priority queue.  

4. Write a   program to insert a given element into a priority queue.  

5. Write a   program to remove all the elements from a priority queue.  

6. Write a   program to count the number of elements in a priority queue.  

7. Write a   program to compare two priority queues.  

8. Write a   program to retrieve the first element of the priority queue.  

9. Write a   program to retrieve and remove the first element.  

10. Write a   program to convert a priority queue to an array containing all of the elements of the queue.  

11. Write a   program to convert a Priority Queue elements to a string representation.  

12. Write a   program to change priorityQueue to maximum priorityqueue.  

HashMap : 

1. Write a   program to associate the specified value with the specified key in a HashMap.  

2. Write a   program to count the number of key-value (size) mappings in a map.  

3. Write a   program to copy all of the mappings from the specified map to another map.  

4. Write a   program to remove all of the mappings from a map.  

5. Write a   program to check whether a map contains key-value mappings (empty) or not.  

6. Write a   program to get a shallow copy of a HashMap instance.  

7. Write a   program to test if a map contains a mapping for the specified key.  

8. Write a   program to test if a map contains a mapping for the specified value.  

9. Write a   program to create a set view of the mappings contained in a map.  

10. Write a   program to get the value of a specified key in a map.  

11. Write a   program to get a set view of the keys contained in this map.  

12. Write a   program to get a collection view of the values contained in this map.  

TreeMap:

1. Write a   program to associate the specified value with the specified key in a Tree Map.  

2. Write a   program to copy a Tree Map content to another Tree Map.  

3. Write a   program to search a key in a Tree Map.  

4. Write a   program to search a value in a Tree Map.  

5. Write a   program to get all keys from the given a Tree Map.  

6. Write a   program to delete all elements from a given Tree Map.  

7. Write a   program to sort keys in Tree Map by using comparator.  

8. Write a   program to get a key-value mapping associated with the greatest key and the least key in a map.  

9. Write a   program to get the first (lowest) key and the last (highest) key currently in a map.  

10. Write a   program to get a reverse order view of the keys contained in a given map.  

11. Write a   program to get a key-value mapping associated with the greatest key less than or equal to the given key.  

12. Write a   program to get the greatest key less than or equal to the given key.  

13. Write a   program to get the portion of a map whose keys are strictly less than a given key.  

14. Write a   program to get the portion of this map whose keys are less than (or equal to, if inclusive is true) a given key.  

15. Write a   program to get the least key strictly greater than the given key. Return null if there is no such key.  

16. Write a   program to get a key-value mapping associated with the greatest key strictly less than the given key. Return null if there is no such key.  

17. Write a   program to get the greatest key strictly less than the given key. Return null if there is no such key.  

18. Write a   program to get NavigableSet view of the keys contained in a map.  

19. Write a   program to remove and get a key-value mapping associated with the least key in a map.  

20. Write a   program to remove and get a key-value mapping associated with the greatest key in this map.  

21. Write a   program to get the portion of a map whose keys range from a given key (inclusive), to another key (exclusive).  

22. Write a   program to get the portion of a map whose keys range from a given key to another key.  

23. Write a   program to get a portion of a map whose keys are greater than or equal to a given key.  

24. Write a   program to get a portion of a map whose keys are greater than to a given key.  

25. Write a   program to get a key-value mapping associated with the least key greater than or equal to the given key. Return null if there is no such key.  

26. Write a   program to get the least key greater than or equal to the given key. Returns null if there is no such key. 

1. Program to iterate HashMap using While and advance for loop.

2. Program to iterate ArrayList using for-loop, while-loop, and advance for-loop

3.Store Information of Students Using Structure

Write a   program to reverse a given linked list.  

Example: For linked list 20->40->60->80, the reversed linked list is 80->60->40->20

Write a   program to remove duplicates from a sorted linked list.  

Original List with duplicate elements:

12->12->13->14->15->15->16->17->17

After removing duplicates from the said list:

12->13->14->15->16->17

Comments

Popular posts from this blog

If & Switch Block