항해99

· 항해99
이진 트리의 최대 깊이 https://leetcode.com/problems/maximum-depth-of-binary-tree Maximum Depth of Binary Tree - LeetCode Can you solve this real interview question? Maximum Depth of Binary Tree - Given the root of a binary tree, return its maximum depth. A binary tree's maximum depth is the number of nodes along the longest path from the root node down to the farthest leaf leetcode.com 접근 방식 트리를 BFS로 탐색해..
· 항해99
조합의 합 https://leetcode.com/problems/combination-sum Combination Sum - LeetCode Can you solve this real interview question? Combination Sum - Given an array of distinct integers candidates and a target integer target, return a list of all unique combinations of candidates where the chosen numbers sum to target. You may return the comb leetcode.com 접근 방식 큐로 만들어서 제일 앞 순서를 지우면서 남은 값들을 더 해주고 타겟과 일치하면..
· 항해99
해시맵 디자인 https://leetcode.com/problems/design-hashmap Design HashMap - LeetCode Can you solve this real interview question? Design HashMap - Design a HashMap without using any built-in hash table libraries. Implement the MyHashMap class: * MyHashMap() initializes the object with an empty map. * void put(int key, int value) inserts a ( leetcode.com 접근 방식 파이썬 알고리즘 인터뷰의 해시맵 디자인 개별 체이닝을 한번 구현 후 문제를 풀..
· 항해99
큐를 이용한 스택 구현 https://leetcode.com/problems/implement-stack-using-queues Implement Stack using Queues - LeetCode Can you solve this real interview question? Implement Stack using Queues - Implement a last-in-first-out (LIFO) stack using only two queues. The implemented stack should support all the functions of a normal stack (push, top, pop, and empty). Implement the leetcode.com 문제 접근 왼쪽으로 추가하고,..
· 항해99
스택 1. 링크드리스트의 반대 방향으로 해준다고 생각했다. - 링크드리스트는 self.top.next = self.top 2. 자바는 배열로 처리했었는데 노드로 스택을 구현해서 스택은 자료구조 일 뿐인걸 다시 생각이 들었다. 꼭 배열이 아니여도 된다는 것 class Node: def __init__(self, data, next=None): self.data = data self.next = next class Stack: def __init__(self): self.top = None def push(self, data): self.top = Node(data, self.top) def pop(self): if not self.top: return None node = self.top.data self..
· 항해99
싱글 링크드 리스트 1. 링크드리스트, 노드가 있는데 링크드리스트에 노드를 이용하여 노드끼리 연결을 해주는 역할 2. head와 tail에 노드가 들어가서 연결 3. head 첫 번째 노드 역할, taild 마지막 노드 역할 4. 단일 링크드리스트는 전 노드를 구해서 삭제를 해준다. (더블 링크드 리스트는 쉽다.) 링크드리스트에 head, tail 생성 후 연결해서 이어주거나 삭제할 때 많이 헷갈렸다 노드에 next, prev을 넣으면 더블 링크드 리스트 tail을 head에 이어주면 순환 링크드 리스트 # 노드 class Node: def __init__(self, data): self.data = data self.next = None # 단일 링크드리스트 class SinglyLinkedList: ..
· 항해99
그룹 애너그램 - https://leetcode.com/problems/group-anagrams/ 나의 접근 방식 1. 입력된 문자를 반복 해준다. 2. 없을경우 새로 만든 배열에 넣어주고, 있으면 문자 비교 후 기존 배열에 담아준다. 3. 2차원 배열 내 문자를 정렬 후, 개수로 재정렬을 한다. 회고 1. defaultdict(list)를 사용하면 존재하지 않는 키여도 접근하면 자동으로 생성 2. 정렬을 하면 key 값이 같기 때문에 key, value 형식으로 값을 넣어주고 3. list로 변환시켜서 속도가 매우 빨라짐 기존에는 반복문을 사용해서 일일이 비교 후 넣었지만, 키값으로 넣어줘서 list로 변환하여 속도가 매우 단축됐습니다. 틀린 예제 - 테스트 케이스는 통과하였지만, 시간초과로 틀렸습..
· 항해99
#1. 개발 공부가 처음이신가요? 처음이 아니라면, 어느 정도 기간을 가지고 어떻게 학습을 하셨나요? - 전문대학에서 3년 개발을 학습 하였습니다. 확실한 공부가 아니여서 비전공자라고 생각합니다. #2. 내가 항해99에 참여한 계기는 무엇인가요? (어떤 역량을 기르고자, 혹은 어떻게 성장하고자 참여하셨는지 구체적으로 작성해주세요.) - 코드에 대해 확신을 가지는 역량을 기르고 싶었습니다. - 기본기를 다시 재확인하며 어떤 부분이 부족한지 확인하면서 학습을 하기 위해 참여하였습니다. #3. 개발자의 역할을 수행하는 데에 있어 나의 강점과 연관된 부분은 무엇이라고 생각하나요? 혹은 보완, 개선하고 싶은 개인 역량이 있나요 ? (과거 혹은 현재의 업무와 연관 지어도 좋습니다. ‘능력’을 기준으로 고민해주세요...
blablax5
'항해99' 카테고리의 글 목록 (7 Page)