분류 전체보기
-
[Python] 자료구조 알고리즘, GraphPython 2024. 8. 2. 06:22
Graph 그래프는 vertex(정점)과 edge(간선)으로 이루어진 비선형의 자료구조를 말한다. 예를 들어 geometrical (기하학적)으로 표현한 그래프는 이런 모양이고 이 그래프를 Mathmatical (수학적)으로 표현하면 아래와 같다.V = {0, 1, 2, 3}E = { (0, 1), (0, 2), (0, 3), (1, 2), (1, 3), (2, 3) } 방향이 있으면 이렇게 된다. ㅎㅎ 우재튜터님의 설명 덕에 그래프들이 귀엽게 보인다. 3번은 인기남❤️ 즉, 방향이 있는 그래프와 없는 그래프로 나뉜다. Undirected Graph : 무방향(양방향) 그래프Directed Graph : 방향(단방향) 그래프 응? 이렇게 거울 보는 것처럼, 자기가 자기한테 오는 간선을 가진 노드..
-
개발자인가 서기인가, 소프트웨어 문서 작성하기Computer Science 2024. 8. 1. 09:57
개발자인가 서기인가 할 정도로 많은 문서를 작성하게 되는게 개발자라고 한다. 문서를 작성하는 이유는 예전 민준튜터님 특강에서 배웠듯이, 소프트웨어의 구조를 '설계'하고 표준을 지향하는 '소통'을 하기 위해서다. 암튼 말 잘 하는 사람이 영업을 잘 하는 것처럼 문서작성을 잘해야 취업도 되고 투자도 받고 상사한테도 인정받을 수 있다는 것. 그럼 어떻게 문서화 해야할까? 1. 읽기 쉬운 문서를 작성한다.읽는 사람 관점에서 쉬운 문서를 작성해야 한다. 문서에 따라 다르겠지만 만약 투자자가 보는 문서에 불필요한 내부 전문용어들이 있다면 문서를 읽고 빠르게 이해하는데 장애물이 될 뿐이다. 그리고 작성자가 문서를 조급하게 쓴다면 머릿속에 떠오른 순서대로 문서를 작성하게 된다. 이건 독자를 위한 구조가 아니다. 보..
-
어제 배운 [백준 1991, 이진 트리 순회] 문제 풀기Python 2024. 7. 31. 09:44
트리 순회 문제이진 트리를 입력받아 전위 순회(preorder traversal), 중위 순회(inorder traversal), 후위 순회(postorder traversal)한 결과를 출력하는 프로그램을 작성하시오.예를 들어 위와 같은 이진 트리가 입력되면,전위 순회한 결과 : ABDCEFG // (루트) (왼쪽 자식) (오른쪽 자식)중위 순회한 결과 : DBAECFG // (왼쪽 자식) (루트) (오른쪽 자식)후위 순회한 결과 : DBEGFCA // (왼쪽 자식) (오른쪽 자식) (루트)가 된다.입력첫째 줄에는 이진 트리의 노드의 개수 N(1 ≤ N ≤ 26)이 주어진다. 둘째 줄부터 N개의 줄에 걸쳐 각 노드와 그의 왼쪽 자식 노드, 오른쪽 자식 노드가 주어진다. 노드의 이름은 A부터 차례대로 ..
-
자료구조 알고리즘, 이진 트리 순회Python 2024. 7. 30. 03:31
Binary Tree 이진 트리의 특징i 번째 레벨의 최대 노드 수: 2^(i-1)깊이가 k인 이진 트리의 최대 노드 수: 2^k-1 이진 트리 순회 Search == Traversal어떠한 값이 주어어졌을 때 해당 값이 일치하는 노드가 있는지 보는 것즉 모든 노드를 봐야 함 방법 (DFS / BFS) DFS• 트리의 한 경로를 끝까지 탐색한 후 다른 경로를 탐색하는 방법• Strack or Recursive를 이용한 구현 세가지 구현 방법 Preorder Traversal (전위순회): 루트 > 왼쪽 > 오른쪽void preorder ( nptr bt ) { if ( bt ) { // 현재 노드(bt)가 NULL이 아닌 경우에만 실행 print ( bt->data ); // 현재 노드의..
-
WIL 한주의 끝인지.. 한주의 시작인지..thoughts💭 2024. 7. 29. 09:10
새로운 조를 만났다. 모두 같은 스쿼드에 있다보니 초반인데도 이야기를 편하게 할 수 있었던 것 같다.스쿼드 숙제는 한 문제도 못 풀었다. 더 쉬운 문제부터 풀면서 기본 개념을 잡아야 할 것 같다.. 우재튜터님이 설명해주실 때는 이해가 되는데 혼자와서 풀어보면 잘 안 풀릴 때가 많다. 그럼 '아까 이해를 못한건가.. 아닌데 분명 이해됐는데... 없어졌나 휘발됐나..' 하고 혼란.. 암튼 이번주 목표는 자료구조를 파악하고 어떻게 풀지 생각하는 것과, 많은 문제를 푸는 것 보단 같은 문제를 최소한 세번 이상 풀어보고 제대로 이해하고 가르쳐줄 수 있는 정도가 되는 것에 둬야겠다. CS는 민준튜터님 말씀대로 따로 요약노트 만들어서 정리하면서 외워야겠다.
-
파이썬 자료구조 알고리즘 2차원 배열, 색종이 문제Python 2024. 7. 29. 05:37
자료구조 알고리즘 2차원 배열문제 우재튜터님이 내주신 문제 3개 중.. 어떻게 하나를 못 풀었다..ㅠㅠ이건 그 중 하나. 색종이 문제가로, 세로의 크기가 각각 100인 정사각형 모양의 흰색 도화지가 있다. 이 도화지 위에 가로, 세로의 크기가 각각 10인 정사각형 모양의 검은색 색종이를 색종이의 변과 도화지의 변이 평행하도록 붙인다. 이러한 방식으로 색종이를 한 장 또는 여러 장 붙인 후 색종이가 붙은 검은 영역의 넓이를 구하는 프로그램을 작성하시오. 먼저 종이에 휴.. 어떻게 시작해야해ㅠㅠㅠ 난 코드보다 생각하고 로직을 세우는 법을 훈련하는게 더 급선무인 것 같다. 결국 마음은 무겁게 양손은 가볍게.. 빈 손으로 스쿼드 출발.. 우재튜터님의 설명을 들었다. 나도 튜터님처럼 사고하고 싶다.. 이..
-
Computer Science 컴퓨터의 구조와 특징Computer Science 2024. 7. 26. 07:36
민준튜터님의 CS 강의를 들으며 적잖이 놀랐다.. 다들 많이 알고 여러가지 질문들을 쏟아내는데 난 스레딩이고 스레드고..잘 모르겠다... 멅티테스킹과 멀티프로세싱의 차이는 뭔지..... 서점가서 책 한 권 사야겠다.. 입력장치와 출력장치를 갖추고 있고, 컴퓨터 내부에는 연산을 처리하는 CPU와 저장을 하기 위한 저장장치가 있다. 사실 이게 내가 이해하고 있었던 컴퓨터(사이언스)의 전부다.. cpu (중앙처리장치) 컴퓨터 내부에서 연산을 처리하는 아주 큰 계산기라고 보면 되는데, 컴퓨터의 주된 일을 처리하는 애다. 박사급의 똑똑한 두뇌를 가진 녀석이다. 주기억장치 (Computer Memory, Primary Memory) 컴퓨터 내부에서 현재 cpu가 처리하고 있는 내용을 저장하고 있는 기억장치로 ..
-
파이썬, 자료구조 알고리즘, array & listPython 2024. 7. 25. 14:14
알고리즘을 공부하면서.. 어렵고.. 힘이 빠졌다. 개념도 개념이지만.. 예제문제를 보면 헛웃음이 나왔다.. '여러분 여기로 가면 됩니다' 하고 지도를 줬는데, 응?... 이게 뭐야 .. 어디로 가라는 거야.. 뭘 하라는 거야.. 이런 생각 때문에..난.. 코드 구현은 고사하고 문제를 이해하는 데만 많은 시간을 썼다. 근데 우재튜터님이 알고리즘은 그럴 수 있다고.. 차근차근 진도를 따라가는 과목이 아니라고. 그 말씀을 들으니 불안했던 마음이 편안하게 불안해졌다. 아무튼 방향성을 바로잡고 다시.. 공부해보기로.. 먼저, 단기적으로 알아야 하는 자료구조들을 살펴보자. 적어도 여기서 선형구조와 비선형구조 안에 있는 자료구조는 꼭 알아야 한다.자료구조를 안다는 건, 이 자료구조가 어떤 데이터를 저장하기 위한..