본문 바로가기

Research/Data structure & algorithm15

01. Array 배열의 정의와 구현(JS) 이 글은 개인 학습 차원에서 정리한 글입니다. 부정확한 부분에 대한 피드백은 항상 큰 도움이 됩니다. 들어가기 이번 글에서는 배열에 대해 알아보겠습니다. 배열에 대해 본격적으로 들어가기 앞서 array라는 단어가 도대체 언제 생겨난 단어인지 궁금해졌습니다. 어원사전을 살펴보니 14세기 중반에 전투를 앞둔 병사들을 정렬시키는 것을 put in order, arrange, get ready라 했습니다. 당시 유럽에서는 국가마다 areyer, arrdare 등 단어로 표현했는데, 이 단어는 라틴어 ad('to') + raed('ready')로 파생된 것으로 추측됩니다. 정라하자면 array라 하면 전쟁을 앞둔 용감한 군사들이 순서에 맞게 도열하는 장면을 떠올리면 되겠습니다. Battle of Hohenfri.. 2023. 2. 5.
s15. Algorithm: Dynamic Programming 212. Dynamic Programming Introduction Dynamic programming is an optimization technique. If you have something you can cache, just do Dynamic Programming. Caching? -> Dynamic Programming 213. Memoization 1 What is Caching? Storage. Caching is the way to store value to use later on. holding datas you need -> speed up prgram by holding something. Memoization is specific form of caching that involve.. 2022. 12. 3.
s13. Algorithm: DFS + DFS(Searching) 192. Searching + Traversal Introduction We do searching everyday. It is part of our lives.. Searching/Traversal Linear Search: O(n) Binary Search: O(log n) Depth First Search Breadth First Search 193. Linear Search In CS, Linear search is the method of finding target values in a list. It is sequential work. ex) [6, 2, 3, 13, 9] best case: O(1) ex) 6 worst case : O(n) ex) 9 But you can not use th.. 2022. 12. 3.
s12. Algorithm: Recursion Background Data Structure + Algorithms = Programs Class {} + function() = Programs What is Algorithms? Algorithms are steps in a process that we take to perform a desired action with computers https://en.wikipedia.org/wiki/List_of_algorithms Why important? Certain algorithms make simplify BigO complexity such as O(2^n) -> O(n) 154. Recursion Introduction Background Recursion is more like a conce.. 2022. 12. 1.