File tree Expand file tree Collapse file tree 1 file changed +4
-9
lines changed
Section9ArrayAB/Array IMP Expand file tree Collapse file tree 1 file changed +4
-9
lines changed Original file line number Diff line number Diff line change 1- Definition:
2-
3- - Array: A fixed-size, contiguous memory data structure that stores elements of the same type.
4-
1+ - Array: A fixed-size, contiguous memory data structure that stores elements of the same type.
52 It provides constant-time (O(1)) access to elements via an index.
63
7- - List (ArrayList/LinkedList): A dynamic collection that can grow or shrink in size.
8-
4+ - List (ArrayList/LinkedList): A dynamic collection that can grow or shrink in size.
95 It is part of Java’s java.util package and allows flexible manipulation of elements.
106
11- `ArrayList` provides fast access, while `LinkedList` is optimized for frequent insertions/deletions.
12-
7+ ArrayList provides fast access, while LinkedList is optimized for frequent insertions/deletions.
138
149Array vs. List in Java:
1510
@@ -24,4 +19,4 @@ Array vs. List in Java:
2419
2520
2621Use Array when performance and fixed size matter.
27- Use List when flexibility and dynamic resizing are needed.
22+ Use List when flexibility and dynamic resizing are needed.
You can’t perform that action at this time.
0 commit comments