Array

2022. 1. 19. 16:05·data structure

배열 생성 시 배열의 길이(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 >

'data structure' 카테고리의 다른 글

Sort  (0) 2022.01.19
Type of Time Complexity (Big O notation)  (0) 2022.01.19
Search Algorithms (Binary Search/ Linear Search)  (0) 2022.01.19
'data structure' 카테고리의 다른 글
  • Sort
  • Type of Time Complexity (Big O notation)
  • Search Algorithms (Binary Search/ Linear Search)
summercat
summercat
세젤귀 또킨이 집사 블로그
  • summercat
    여름고양이
    summercat
  • 전체
    오늘
    어제
    • 분류 전체보기 (28)
      • Swift-iOS (4)
        • iOS (1)
        • Swift (2)
      • 네트워크 (1)
      • data structure (4)
      • Git (6)
      • Java (13)
        • project lion JSB the origin (10)
        • ByteDegree (3)
  • 블로그 메뉴

    • 홈
    • 태그
    • 방명록
  • 링크

  • 공지사항

  • 인기 글

  • 태그

    HTTP message
    Cow
    값 타입
    Github
    메모리 구조
    ssh-configure
    ssh-add
    copy on write
    딥링크
    부트캠프
    JSON
    multipart/form-data
    ssh-agent
    IOS
    HTTP Methods
    유니버셜링크
    Endpoint
    네트워크
    universal link
    커리어스타터캠프
    URLQueryItem
    deeplink
    OSI
    참조 타입
    앱개발
    URLComponents
    어플
    야곰아카데미
    SWIFT
    TCP
  • 최근 댓글

  • 최근 글

  • hELLO· Designed By정상우.v4.10.1
summercat
Array
상단으로

티스토리툴바