본문 바로가기

Research/Data structure & algorithm15

s11. Data Structure: Graphs What is Graphs? A graph is a non-linear data structure consisting of vertices and edges. node(=vertex) edge : lines or arcs connecting two nodes The graph is denoted by G(E, V). Graphs are useful for modeling real life such as shortest-path guid(Google maps), social network(Facebook), recommendation engine(Amazon) etc. 그래프는 비선형적 데이터 구조 중 하나로 노드(벌텍스)들과 엣지들로 구성된다. 여기서 엣지는 두 노드를 연결하는 선을 의미한다. Pros .. 2022. 11. 30.
s10. Data Structure: Trees 126. Trees Introduction *Abstract Syntax tree What is Tree data structure Trees have hierarchical structure. In contrast, array, linked lists, stacks, queue have linear structure. in tree data structure node can point only its child 트리 구조의 핵심은 1) 수직 구조이며 2)노드가 가리킬 수 있는 것은 노드의 자식 뿐이다. 수평 구조를 가진 다른 어레이, 링크드리스트, 스택, 큐 등과 차이점이다. Element of Tree structure Root Parent Child Leaf Sibling 트리구조의 구성 요소는 크.. 2022. 11. 29.
Data Structure: Stacks + Queues 111. Stacks + Queues Introduction Stacks + Queues Common Stacks and queues is linear data structure. no random access operation -> limit -> better control Difference how data is removed Pros and Cons (Stacks + Queues) Pros Fast operations Fast Peek Ordered Cons Slow Lookup 스택과 큐의 공통점은 1)선형적인 데이터 구조라는 점 그리고 2)외부에서 무작위로 데이터에 접근할 수 없어 데이터를 관리하기가 용이하다는 점이다. 차이점은 데이터를 어느 방향으로 빼내느냐에 달려있다. 두 데이터 구조와 다른.. 2022. 11. 28.
Data Structure: Hash Tables 077. Hash Tables Introduction What is Hash Tables? Arrays have indexes and values. Hash tables have keys and values. You can use keys as an index. It works with hash function. Hash table’s function is to optimize the nested loop which is O(n^2) Pros and Conds? Pros Fast lookups Fast inserts Flexible Keys (but Good collision resolution required) Cons Unordered Slow key iteration. If you want to g.. 2022. 11. 25.