본문 바로가기

전체 글

(49)
[Java Script] 208. Implement Trie (Prefix Tree) 1. 문제 개요 문제 링크 : 208. Implement Trie (Prefix Tree) Implement Trie 구현 검색하려는 단어가 존재할시 true 없을시 false 반환 startWith 기능 구현(LIKE) 2. 문제 풀이 트리의 기능을 구현하는 문제이기에 기본적이 트리 기능을 구현후 테스트를 진행했습니다. 트리에 대해 이해하고 있느냐의 문제이기에 주석을 사용한 구조는 생략합니다. LeetCode 요구 양식으로 코드 구현 class TrieNode { constructor() { this.children = {} this.endWord = false } } var Trie = function() { this.root = new TrieNode() }; Trie.prototype.insert..
[Java Script] 637. Average of Levels in Binary Tree 1. 문제 개요 문제 링크 : 637. Average of Levels in Binary Tree Average of Levels in Binary Tree - LeetCode Can you solve this real interview question? Average of Levels in Binary Tree - Given the root of a binary tree, return the average value of the nodes on each level in the form of an array. Answers within 10-5 of the actual answer will be accepted. Examp leetcode.com 주어진 이진 트리에서 각 레벨별 평균값을 반환하시오 2. ..
[Java Script] 199. Binary Tree Right Side View 1. 문제 개요 문제 링크 : 199. Binary Tree Right Side View Binary Tree Right Side View - LeetCode Can you solve this real interview question? Binary Tree Right Side View - Given the root of a binary tree, imagine yourself standing on the right side of it, return the values of the nodes you can see ordered from top to bottom. Example 1: [https://asse leetcode.com 이진 트리가 주어지면 맨 우측에 있는값들만 반환하는 문제입니다. (그림참고)..