코테 대비 python/자료구조 및 알고리즘
-
그래프와 탐색코테 대비 python/자료구조 및 알고리즘 2023. 3. 7. 14:56
그래프란?? 자료 구조로써 그래프 = 정점 + 간선의 형태를 그래프라고 한다. 간선 => (무방향 / 방향) + 가중치 무방향 = 양방향 이라고도 함 정점의 차수(Degree)와 성질 모든 정점의 차수의 합 = 간선의 개수의 2배이다. 그래프를 저장하는 대표적인 두가지 방법 1. 인접 행렬 2. 인접 리스트 탐색이란?? 시작점에서 간선을 0개 이상 사용해서 갈 수 있는 정점들은? 1. 깊이 우선 탐색 (DFS) 2. 너비 우선 탐색 (BFS) 상황에 따라서 어떤 것을 사용해야 할지 결정해야한다.
-
-
투 포인터코테 대비 python/자료구조 및 알고리즘 2023. 1. 25. 22:03
특정 자료구조나 알고리즘은 아니지만 두개의 점 혹은 두개의 가리키는 포인트를 이용하여 점이나 포인트를 옮겨가면서 결과값을 만족시키는 것 https://leetcode.com/problems/two-sum/ Two Sum - LeetCode Two Sum - Given an array of integers nums and an integer target, return indices of the two numbers such that they add up to target. You may assume that each input would have exactly one solution, and you may not use the same element twice. You can return leetcode...