CS205

Basic Arrays

Learn the fundamentals of arrays: declaration, initialization, accessing elements, and basic operations like insertion and deletion.

Array Visualization

Array
640341252123224115906
Default
Comparing
Sorted

Key Concepts

What is an Array?

An array is a collection of elements stored at contiguous memory locations. Each element can be accessed using its index, starting from 0.

Time Complexity

  • Access: O(1) - Direct index access
  • Search: O(n) - Linear search
  • Insert: O(n) - May require shifting
  • Delete: O(n) - May require shifting