DS 3

자료구조 | Binary Search Trees | 숙명여대 학점교류

숙명여대 학점교류로 듣는 자료구조 day 12. 2022.1.6. 목요일 Binary Search Trees Binary search Trees Balanced binary search trees : AVL Tree heap provides a good performance of O(log2n) only when handling the root for searching other item than the root, it takes O(n) time why binary search tree is necessary requires O(log2n) for any item, which is proportional to tree height (h) => 이진 탐색을 트리로 구현한 것 Binary search tr..

자료구조 | Trees | 숙명여대 학점교류

학점교류로 듣는 숙명여대 자료구조 day 9. 2022.1.3. 월요일 1. Introduction 2. Binary Trees 3. Threaded Binary Trees 4. Heaps Tree def) A hierarchical data structure that consists of one or more nodes 계층적 자료 구조 root / sub trees 트리는 그래프의 부분 집합 다 그래프인데, 루트가 독립되어있어서.. 노드들이 연결된 것을 그래프라고 한다. Huffman Coding Tree Text compression method based on the frequency example : "time and tide wait for no man" 단말 노드를 만들어준다. 자식 노드를 ..

자료구조 | Maze Problem | linear DS

미로 탈출하기 문제 : 입구로부터 출구로 나가는 길을 찾아라! 조건 : 0은 움직일 수 있는 길, 1은 불가능한 길이다. 방향 : 상하좌우, 대각선으로 움직일 수 있다. 추가적인 안내 미로는 2차원 배열에 구현되어 있다. 입구는 maze[0][0]이고, 출구는 maze[row-1][col-1]이다. 나가는 길을 찾기 위해 move[0] move[1] move[2] move[3] 을 사용할 수 있다. maze[next_row][next_col] = ? mark라는 배열을 만들어 지나온 길을 기록해둔다. mark = [[0]*10 for i in range(10)] mark=[[0]*10 for i in range(10)] print(mark) path stack backtracking을 위한 stack으로..