목록2022/01/25 (2)
Developer_Neo
테이블이란? 표와 같은것으로 모든표를 가리켜 테이블이라 하지않는다. 따라서 저장된 데이터의 형태가 키(key)와 값(value)로 하나의 쌍을 이룰때에만 테이블로 구분짓는다. 이때 키는 데이터를 구분하는 기준이 되기 때문에 모든 키는 중복 되지않고 키가 존재하지 않는 값은 저장할 수 없다. 해쉬 테이블이란? Key와 Value로 데이터를 저장하는 자료구조 중 하나로 빠르게 데이터를 검색할 수 있는 자료구조 해시함수를 사용하여 키를 해시값으로 매핑하고, 이 해시값을 인덱스 혹은 주소 삼아 데이터의 값(value)을 키와 함께 저장하여 검색을 빠르게 하기 위한 자료 구조 위에서 말했던 테이블과 다른점은 해쉬함수를 이용한다는 것이다. 예) 파이썬 사전(Dictionary) 자료형 - Key를 가지고 바로 데이..
왜? 배우는가 하나의 문제를 푸는 알고리즘은 다양할 수 있다 이 다양한 알고리즘 중 어느 알고리즘이 더 좋은지 분석하기 위해, 복잡도를 정의하고 계산한다. 종류 시간복잡도 : 얼마나 빠르게 실행되고 결과를 도출하느냐 공간복잡도 : 얼마나 공간(메모리 사이즈)을 쓰느냐 둘 중에 더 중요한 것은 시간복잡도이다. 왜냐하면 요즘은 메모리가 매우 커졌기 때문에 시간복잡도보다는 중요도가 후 순위이다. 시간복잡도의 주요요소 - 반복문이 주요요소이다. 즉 반복문이 가장 영향을 많이 미친다.(입력의 크기가 커지면 반복문이 알고리즘 수행시간을 지배한다.) 그러면 시간복잡도를 우리 눈에 보기 좋게 객관적으로 표현을 해야 비교가 가능하다. 그래서 나온것이 빅오 표기법이다. 알고리즘 성능 표기법 Big O (빅-오) 표기법: ..