본문 바로가기

분류 전체보기162

Weather Observation Station 19, 유클리드 거리 구하기 Consider P1(a, c) and P2(b, d)to be two points on a 2D plane where (a, b) are the respective minimum and maximum values of Northern Latitude (LAT_N) and (c, d) are the respective minimum and maximum values of Western Longitude (LONG_W) in STATION.Query the Euclidean Distance between points P1 and P2 and format your answer to display 4 decimal digits. 2D 평면상 P1(a, b)와 P2(b, d)들을 고려하세요. (a, b)는.. 2025. 4. 16.
균일 분포와 균등 분포 그리고 RandomizedSearch 균일 분포와 균등 분포는 본질적으로 같은 개념을 가리키는 용어입니다. 두 용어 모두 확률론과 통계학에서 사용되는 분포로, 특정 범위 내의 모든 값이 동일한 확률을 가지는 분포를 의미합니다.균일 분포/균등 분포(Uniform Distribution)기본 개념주어진 범위 내에서 모든 값이 발생할 확률이 동일한 분포주사위를 던지거나 카드를 뽑는 등의 상황에서 볼 수 있는 분포수학적으로는 모든 값에 대해 확률 밀도 함수(PDF)가 일정한 값을 가짐종류이산 균일 분포(Discrete Uniform Distribution)유한한 개수의 값들이 동일한 확률을 가짐예: 주사위를 던질 때 1부터 6까지의 숫자가 나올 확률은 모두 1/6로 동일연속 균일 분포(Continuous Uniform Distribution)연속적.. 2025. 4. 15.
Weather Observation Station 18 Consider P1(a, b) and P2(a, b) to be two points on a 2D plane. a happens to equal the minimum value in Northern Latitude (LAT_N in STATION). b happens to equal the minimum value in Western Longitude (LONG_W in STATION). c happens to equal the maximum value in Northern Latitude (LAT_N in STATION). d happens to equal the maximum value in Western Longitude (LONG_W in STATION).Query the Manhattan D.. 2025. 4. 15.
New Companies Amber's conglomerate corporation just acquired some new companies. Each of the companies follows this hierarchy: Given the table schemas below, write a query to print the company_code, founder name, total number of lead managers, total number of senior managers, total number of managers, and total number of employees. Order your output by ascending company_code.Note:The tables may contain dupli.. 2025. 4. 15.
가상함수 가상 함수(virtual function)에 대해 초보자 관점에서 설명해 드리겠습니다.1. 가상함수는 왜 쓰는 건가요?가상함수는 다형성(polymorphism)을 구현하기 위해 사용합니다. 쉽게 말하면, 같은 함수 이름으로 다른 동작을 할 수 있게 해주는 기능입니다.예를 들어봅시다. 동물이라는 부모 클래스가 있고, 강아지와 고양이라는 자식 클래스가 있다고 생각해보세요. 모든 동물은 "소리를 낸다"는 기능이 있지만, 강아지는 "멍멍", 고양이는 "야옹"하고 다른 소리를 냅니다. 가상함수를 사용하면 동물이라는 공통 타입으로 강아지나 고양이를 참조하더라도, 각자 자신에게 맞는 소리를 낼 수 있게 됩니다.2. 가상함수는 언제 쓰는 건가요?가상함수는 주로 다음과 같은 상황에서 사용합니다:상속 관계에서 부모 클래스.. 2025. 4. 15.
Binary Tree Nodes 문제You are given a table, BST, containing two columns: N and P, where N represents the value of a node in Binary Tree, and P is the parent of N. Write a query to find the node type of Binary Tree ordered by the value of the node. Output one of the following for each node:Root: If node is root node.Leaf: If node is leaf node. Inner: If node is neither root nor leaf node. BST라는 테이블이 주어지며, 이 테이블에는 N.. 2025. 4. 14.