배열 생성 시 배열의 길이(size)를 지정해야 함 (JS, Python의 경우 언어에서 이 부분을 핸들링해주기 때문에 길이를 지정하지 않고 생성 가능)
Characteristics of array
- 0-indexed: array’s elements are indexed from 0
- very fast when reading data, but slow in searching/adding/deleting
Types of Operation and how it works
- Read: give index number of an element and get it > super fast
- Search: find the element the user wants > have to check every element of an array from index 0 until you find the element you want (linear search) > not very fast
- Insert(add): the speed depends on where new element is added
if an element is added in between / at the start of an array, elements that comes later than the added element should be moved to next index before new element is added
if total number of elements get larger than given size of the array, copy the original array to a new array and add element
- Delete:
if the user wants to remove an element in middle/start, elements that comes after should be moved forth >