본문 바로가기

Research/Data structure & algorithm15

Data Structure: Arrays 065. Arrays Introduction What Is Arrays? Arrays organize data sequentially. Array는 한 마디로 정보들을 나란히 정렬시킨 형태의 데이터 구조다. Pros and Cons? Pros Fast lookups Fast push/pop Ordered Cons Slow inserts Slow deletes Fixed size(if static array) Big O in Arrays lookup: O(1) push: O(1) insert: O(n) delete: O(n) const strings = ['a', 'b', 'c', 'd']; // saving datas in sequential memory // 4 * 4 = 16 bytes of stor.. 2022. 11. 24.
Data Structure: Introduction Reference https://www.geeksforgeeks.org/data-structures/ https://en.wikipedia.org/wiki/List_of_data_structures https://statmath.wu.ac.at/courses/data-analysis/itdtHTML/node55.html https://www.youtube.com/watch?v=fpnE6UAfbtU&ab_channel=CrashCourse https://protect.bju.edu/cps/docs/cps110/textbook/ch01s01.html https://medium.com/omarelgabrys-blog/data-structures-language-support-5f70f8312e84 060. S.. 2022. 11. 24.
Big O의 개념, 유형, 계산 원칙 그리고 의미 좋은 코드란? 좋은 코드란 가독성이 좋거나 확장성이 있는 것을 의미한다. 확장성은 다시 시간 복잡도와 공간 복잡도 관점에서 볼 수 있는데, 두 관점은 상충하기 때문에 하나를 얻기 위해선 하나를 희생해야 한다. Big O는 확장성과 관련되어있다. 확장성이 항상 옳은 것이 아니며 빠른 행동이 중요한 스타트업의 경우 가독성을 우선하기도 한다. Big O란? 확장 시 얼마나 시간이 더 오래 걸리는지 측정하는 지표가 Big O다. 걸리는 시간 그 자체가 중요한 것이라기 보다는 얼마나 더 느려지는 가에 초점을 맞추면 되겠다. Big O의 유형 Big O의 유형은 여러가지가 있다. O(1), O(log N), O(n), O(n log(n)), O(n^2), O(n!)가 있다 To review what I learne.. 2022. 11. 23.