Data Structure in Java
Types of Data Structures: A data structure is way of collecting and organizing data Choosing the right data structure impacts efficiency Data comes from many sources e.g. Database, Files etc. Many data structures are implemented using as Linked list (Stack, queue etc.) Array List: Stores objects and can grow or shrink Linked List: Uses pointers to keep track of elements Vector: Can grow or shrink, It provides synchronization Stack: Operates on Last In , First Out (LIFO) Queue: Operates on First In, First Out (FIFO) Array List and Vectors: Advantages: Provide fast access using indexing Memory Coherence Provide an initial size (optional) User internal array for storage, which makes random access fast Disadvantages: Can be time consuming to add elements in the middle Waste space if array is not full Need to be resized when they reach capacity Slower when deleting elements from the middle Linked List: Advantages: Insertion and deletion operations are easily implemented Elements are ef...