binary3 이진수<-> 십진수 소수 파트 => fractional part: Binary number <-> Decimal number Decimal to Binary To convert the fractional part of a decimal number to binary, you can use the following steps: Multiply the fractional part by 2. Write down the integer part of the result. Repeat step 1 with the fractional part of the result from the previous step. Continue this process until the fractional part becomes 0 or until you have obtained the desired number of binary digits. For exam.. 2023. 3. 26. [javascript] how to parse string to number, Number, parseInt, + Number() converts the type whereas parseInt parses the value of input. Number('123'); parseInt('123', 10); +'123'; Parseing string with non-digit character Number('123 asf'); // NaN parseInt('123 asf'); // 123 As you see, parseInt will parse up to the first non-digit character. On the other hand, Number will try to convert the entire string. binary, decimal parseInt('0101'); // 101 parseInt('010.. 2022. 7. 12. [BST] Construct binary search tree methods :: insert, contains, remove(delete) BST definition BST class BST { constructor(value) { this.value = value; this.left = null; this.right = null; } insert(value) { let currentNode = this; while (currentNode !== null) { if (currentNode.value > value) { if (currentNode.left === null) { currentNode.left = new BST(value); } else { currentNode.left.insert(value); } } else { if (currentNode.right === null) { currentNode.right = new BST(v.. 2022. 7. 4. 이전 1 다음