Skip to content

Search last item in an ArrayList and Linked List

M. Hamza Haroon requested to merge task-7-branch into main
  1. Write a java program that searches last item in an ArrayList and Linked List and prints the search time in milliseconds to check which collection is faster in traversing and searching a particular item.

NOTE: The data stored in both the collections is the same and the item searched is also fixed according to position in the collection.

e.g [23, 44, -9, 14, 123, 56, 223, 445, 33, 45, 89, 1, 0, 21, 100] and you are finding "100"(last item) in both the collections.

Merge request reports