Skip to content

Commit 41d9114

Browse files
committed
Array vs List.
Signed-off-by: Somesh diwan <[email protected]>
1 parent 7d32769 commit 41d9114

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

Section9ArrayAB/Array IMP/Array vs List.txt

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,12 +6,12 @@ Definition
66

77
- List (ArrayList/LinkedList): A dynamic collection that can grow or shrink in size.
88

9-
It is part of Java’s `java.util` package and allows flexible manipulation of elements.
9+
It is part of Java’s java.util package and allows flexible manipulation of elements.
1010

1111
`ArrayList` provides fast access, while `LinkedList` is optimized for frequent insertions/deletions.
1212

1313

14-
Array vs. List in Java (Short Theory):
14+
Array vs. List in Java:
1515

1616
| Feature | Array | List (ArrayList/LinkedList) |
1717
|-----------------------|-------------------------------------------|----------------------------------------------------------------------------|
@@ -22,6 +22,6 @@ Array vs. List in Java (Short Theory):
2222
| Implementation | int[] arr = new int[5]; | List<Integer> list = new ArrayList<>(); |
2323
| Best For | When size is known & fixed | When frequent insertions/deletions are needed |
2424

25-
👉 Use Array when performance & fixed size matter.
26-
27-
👉 Use List when flexibility & dynamic resizing are needed.
25+
26+
Use Array when performance and fixed size matter.
27+
Use List when flexibility and dynamic resizing are needed.

0 commit comments

Comments
 (0)