목록node (3)
N

235. Lowest Common Ancestor of a Binary Search Tree Given a binary search tree (BST), find the lowest common ancestor (LCA) of two given nodes in the BST. According to the definition of LCA on Wikipedia: “The lowest common ancestor is defined between two nodes p and q as the lowest node in T that has both p and q as descendants (where we allow a node to be a descendant of itself).” Example 1: In..

생활코딩 강의를 바탕으로 쓴 글입니다 :) 동적인 웹 페이지 만들기 지난번 만들었던 웹 페이지에서 WEB, HTML, CSS, JavaScript를 클릭 했을 때 동적으로 변하는 웹 페이지를 만들어 보도록 하겠습니다. 간단한 설명을 위해 html.html 파일에서 모든 코드를 복사하겠습니다. 그 후 main.js에 template라는 변수로 저장하도록 하겠습니다. const http = require("http"); const fs = require("fs"); const url = require("url"); const app = http.createServer((req, res) => { var _url = req.url; var queryData = url.parse(_url, true).query..

생활코딩 강의를 바탕으로 쓴 글입니다 :) Node.js 설치 nodejs.org/ko/download/ 다운로드 | Node.js Node.js® is a JavaScript runtime built on Chrome's V8 JavaScript engine. nodejs.org 진행하기에 앞서 node.js를 설치합니다. 각 OS에 맞게 설치하면 됩니다! Node.js 실행 node.js가 설치 되었으면 실행을 해보도록 하겠습니다. 저는 vs code를 이용하여 실행하겠습니다. 우선 원하는 폴더에 main.js를 만들어 주도록 합니다. 그리고 이제까지 만들었던 (html, css, js, index).html 파일들을 main.js 경로가 있는 곳으로 복사나 이동. //main.js const htt..