Data structure Flashcards
1
Q
A
2
Q
Arrays
A
A data structure that stores a collection of items at contiguous memory locations.
3
Q
Array
A
Fixed size, elements accessed by index, efficient for random access.
- Example: int[] numbers = {1, 2, 3, 4, 5}
4
Q
Linked Lists
A
Definition: A data structure consisting of a sequence of elements, each pointing to the next
5
Q
Linked list
A
-Dynamic size, elements accessed sequentially, efficient for insertion/deletion.
- Types: Singly linked list, doubly linked list.
6
Q
Stack
A
- Definition: A data structure that follows the Last In, First Out (LIFO) principle.
- Operations: Push (add element), Pop (remove top element), Peek (view top element).
- Example: Function call stack.