Siksha Sarovar

Siksha Sarovar (sikshasarovar.com) is a free educational web application that helps students in India learn programming and prepare for academic and competitive exams. The platform offers structured coding courses (C, C++, Python, Java, HTML, CSS, PHP, Power BI, AI, Machine Learning, Data Science), complete university curriculum notes for BCA/MCA students with previous year question papers, Class 10 and Class 12 CBSE/HBSE school notes, and dedicated preparation material for SSC, UPSC, Banking, Railway and other government exams. Browsing the site is completely free and requires no account. Users may optionally sign in with Google solely to save their learning progress, quiz scores and personal preferences across devices.

Privacy Policy | Terms of Service | Contact Siksha Sarovar | About Siksha Sarovar

v4.0.9 · PWA
Siksha Sarovar logo
Siksha Sarovar
Your Learning Universe

Siksha Sarovar is a free e-learning platform for coding courses, BCA university notes and competitive exam preparation. Optional Google sign-in saves your learning progress across devices.

Initializing knowledge base…
Compiling modules 0%

List Interface

Lesson 31 of 39 in the free Java notes on Siksha Sarovar, written by Rohit Jangra.

List Interface

List is a child interface of Collection. It represents an ordered collection of objects. Key Features:

  1. Insertion Order: Preserved (Elements appear in the order they are inserted).
  2. Duplicates: Allowed.
  3. Index-Based Access: Elements can be accessed via index positions (0 to n-1).
  4. Null Values: Supported.

Implementation Classes

The List interface is implemented by:

  1. ArrayList
  2. LinkedList
  3. Vector
  4. Stack

1. ArrayList

Underlying Data Structure: Dynamic Array (Resizable Algorithm). • Performance: Good for Retrieval (Random Access is fast). Slow for Manipulation (Insertion/Deletion requires shifting). • Synchronization: Not Synchronized (Not Thread-safe). • Growth: Increases size by 50% when full.

2. LinkedList

Underlying Data Structure: Doubly Linked List. • Performance: Good for Manipulation (No shifting needed). Slow for Retrieval (Sequential Access). • Synchronization: Not Synchronized. • Interfaces: Implements both List and Deque.

3. Vector

Legacy Class: Introduced in JDK 1.0. • Synchronization: Synchronized (Thread-safe). Slower than ArrayList. • Growth: Doubles size (100%) when full.

4. Stack

• Child class of Vector. • Principle: LIFO (Last In First Out). • Methods: push(), pop(), peek(), search().

ArrayList vs LinkedList

FeatureArrayListLinkedList
StructureDynamic ArrayDoubly Linked List
AccessFast (O(1))Slow (O(n))
InsertionSlow (Shift needed)Fast (Ref change)
MemoryLessMore (Nodes store address)