Loading...
Loading...
Loading Curriculum...
Loading Subject...
Loading Topic...
Loading Lesson...
Loading Lab...
A simple list of elements. Each element is accessed by a single index representing its position in the sequence.
int a[5] = {10, 20, 30, 40, 50}; // Full
int b[5] = {1, 2}; // Partial {1,2,0,0,0}
int c[] = {1, 2, 3}; // Auto-sized [3]
int d[5] = {0}; // All zerosfor (int i = 0; i < 5; i++) {
cout << arr[i] << " ";
}1D arrays are the foundation for more complex structures like Stacks, Queues, and Hash Tables. They provide O(1) time complexity for random access.