Skip to content

[togo26] WEEK 02 solutions#2700

Merged
togo26 merged 12 commits into
DaleStudy:mainfrom
togo26:main
Jul 4, 2026
Merged

[togo26] WEEK 02 solutions#2700
togo26 merged 12 commits into
DaleStudy:mainfrom
togo26:main

Conversation

@togo26

@togo26 togo26 commented Jul 3, 2026

Copy link
Copy Markdown
Contributor

๋‹ต์•ˆ ์ œ์ถœ ๋ฌธ์ œ

์ž‘์„ฑ์ž ์ฒดํฌ ๋ฆฌ์ŠคํŠธ

  • Projects์˜ ์˜ค๋ฅธ์ชฝ ๋ฒ„ํŠผ(โ–ผ)์„ ๋ˆŒ๋Ÿฌ ํ™•์žฅํ•œ ๋’ค, Week๋ฅผ ํ˜„์žฌ ์ฃผ์ฐจ๋กœ ์„ค์ •ํ•ด์ฃผ์„ธ์š”.
  • ๋ฌธ์ œ๋ฅผ ๋ชจ๋‘ ํ‘ธ์‹œ๋ฉด ํ”„๋กœ์ ํŠธ์—์„œ Status๋ฅผ In Review๋กœ ์„ค์ •ํ•ด์ฃผ์„ธ์š”.
  • ์ฝ”๋“œ ๊ฒ€ํ† ์ž 1๋ถ„ ์ด์ƒ์œผ๋กœ๋ถ€ํ„ฐ ์Šน์ธ์„ ๋ฐ›์œผ์…จ๋‹ค๋ฉด PR์„ ๋ณ‘ํ•ฉํ•ด์ฃผ์„ธ์š”.

๊ฒ€ํ† ์ž ์ฒดํฌ ๋ฆฌ์ŠคํŠธ

Important

๋ณธ์ธ ๋‹ต์•ˆ ์ œ์ถœ ๋ฟ๋งŒ ์•„๋‹ˆ๋ผ ๋‹ค๋ฅธ ๋ถ„ PR ํ•˜๋‚˜ ์ด์ƒ์„ ๋ฐ˜๋“œ์‹œ ๊ฒ€ํ† ๋ฅผ ํ•ด์ฃผ์…”์•ผ ํ•ฉ๋‹ˆ๋‹ค!

  • ๋ฐ”๋กœ ์ด์ „์— ์˜ฌ๋ผ์˜จ PR์— ๋ณธ์ธ์„ ์ฝ”๋“œ ๋ฆฌ๋ทฐ์–ด๋กœ ์ถ”๊ฐ€ํ•ด์ฃผ์„ธ์š”.
  • ๋ณธ์ธ์ด ๊ฒ€ํ† ํ•ด์•ผํ•˜๋Š” PR์˜ ๋‹ต์•ˆ ์ฝ”๋“œ์— ํ”ผ๋“œ๋ฐฑ์„ ์ฃผ์„ธ์š”.
  • ํ† ์š”์ผ ์ „๊นŒ์ง€ PR์„ ๋ณ‘ํ•ฉํ•  ์ˆ˜ ์žˆ๋„๋ก ์Šน์ธํ•ด์ฃผ์„ธ์š”.

@dalestudy

dalestudy Bot commented Jul 3, 2026

Copy link
Copy Markdown
Contributor

๐Ÿ“Š togo26 ๋‹˜์˜ ํ•™์Šต ํ˜„ํ™ฉ

์ด๋ฒˆ ์ฃผ ์ œ์ถœ ๋ฌธ์ œ

๋ฌธ์ œ ๋‚œ์ด๋„ ์œ ํ˜• ๋ถ„์„
3sum Medium โœ… ์˜๋„ํ•œ ์œ ํ˜•
climbing-stairs Easy โœ… ์˜๋„ํ•œ ์œ ํ˜•
product-of-array-except-self Medium โœ… ์˜๋„ํ•œ ์œ ํ˜•
valid-anagram Easy โœ… ์˜๋„ํ•œ ์œ ํ˜•
validate-binary-search-tree Medium โœ… ์˜๋„ํ•œ ์œ ํ˜•

๋ˆ„์  ํ•™์Šต ์š”์•ฝ

  • ํ’€์ดํ•œ ๋ฌธ์ œ: 5 / 75๊ฐœ
  • ์ด๋ฒˆ ์ฃผ ์œ ํ˜• ์ผ์น˜์œจ: 100% (5๋ฌธ์ œ ์ค‘ 5๋ฌธ์ œ ์ผ์น˜)

๋ฌธ์ œ ํ’€์ด ํ˜„ํ™ฉ

์นดํ…Œ๊ณ ๋ฆฌ ์ง„ํ–‰๋„ ์™„๋ฃŒ
Heap โ– โ– โ–กโ–กโ–กโ–กโ–ก 1 / 3 (Medium 1)
Array โ– โ–กโ–กโ–กโ–กโ–กโ–ก 2 / 10 (Easy 2)
Graph โ– โ–กโ–กโ–กโ–กโ–กโ–ก 1 / 8 (Medium 1)
Dynamic Programming โ– โ–กโ–กโ–กโ–กโ–กโ–ก 1 / 11 (Medium 1)
Binary โ–กโ–กโ–กโ–กโ–กโ–กโ–ก 0 / 5 โ† ์•„์ง ์‹œ์ž‘ ์•ˆ ํ•จ
Interval โ–กโ–กโ–กโ–กโ–กโ–กโ–ก 0 / 5 โ† ์•„์ง ์‹œ์ž‘ ์•ˆ ํ•จ
Linked List โ–กโ–กโ–กโ–กโ–กโ–กโ–ก 0 / 6 โ† ์•„์ง ์‹œ์ž‘ ์•ˆ ํ•จ
Matrix โ–กโ–กโ–กโ–กโ–กโ–กโ–ก 0 / 4 โ† ์•„์ง ์‹œ์ž‘ ์•ˆ ํ•จ
String โ–กโ–กโ–กโ–กโ–กโ–กโ–ก 0 / 10 โ† ์•„์ง ์‹œ์ž‘ ์•ˆ ํ•จ
Tree โ–กโ–กโ–กโ–กโ–กโ–กโ–ก 0 / 14 โ† ์•„์ง ์‹œ์ž‘ ์•ˆ ํ•จ

๐Ÿค– ์ด ๋Œ“๊ธ€์€ GitHub App์„ ํ†ตํ•ด ์ž๋™์œผ๋กœ ์ž‘์„ฑ๋˜์—ˆ์Šต๋‹ˆ๋‹ค.

๐Ÿ”ข API ์‚ฌ์šฉ๋Ÿ‰ (gpt-5-nano)
์š”์ฒญ ์ž…๋ ฅ ํ† ํฐ ์ถœ๋ ฅ ํ† ํฐ ํ•ฉ๊ณ„ ๋น„์šฉ
1 2,306 219 2,525 $0.000203
2 2,310 185 2,495 $0.000190
ํ•ฉ๊ณ„ 4,616 404 5,020 $0.000392

@parkhojeong parkhojeong left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

์ˆ˜๊ณ ํ•˜์…จ์Šต๋‹ˆ๋‹ค~! ๊ฐ€๋…์„ฑ์ด ์ข‹์€ ์ฝ”๋“œ ์ž‘์„ฑํ•ด์ฃผ์…”์„œ ์‰ฝ๊ฒŒ ์ฝํ˜”๋˜ ๊ฑฐ ๊ฐ™์Šต๋‹ˆ๋‹ค!
์ปค๋ฉ˜ํŠธ ๋‚จ๊ฒจ๋ณด์•˜์Šต๋‹ˆ๋‹ค :)

Comment on lines +8 to +10
if (!node) return true;
if (!(min < node.val && node.val < max)) return false;
return traverse(node.left, min, node.val) && traverse(node.right, node.val, max);

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

๊ฐ€๋…์„ฑ ์ข‹๊ฒŒ ์ž˜ ํ’€์–ด์ฃผ์‹  ๊ฑฐ ๊ฐ™์Šต๋‹ˆ๋‹ค!

Comment on lines +2 to +37
var productExceptSelf = function (nums) {
const left = [1];
const right = [1];
const result = [];

for (let i = 1; i < nums.length; i++) {
left.push(left[i - 1] * nums[i - 1]);
}

for (let i = nums.length - 1; i > 0; i--) {
right.push(right[nums.length - 1 - i] * nums[i]);
}

for (let i = 0, j = nums.length - 1; i < nums.length; i++, j--) {
result[i] = left[i] * right[j];
}

return result;
};

// TC: O(n) / SC: O(1)
var productExceptSelf = function (nums) {
const left = new Array(nums.length).fill(1);

for (let i = 1; i < nums.length; i++) {
left[i] = left[i - 1] * nums[i - 1];
}

let rightProduct = 1;
for (let i = nums.length - 1; i >= 0; i--) {
left[i] *= rightProduct;
rightProduct *= nums[i];
}

return left;
};

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

์ฒซ๋ฒˆ์งธ ํ’€์ด๊ฐ€ left, right, result๋ฅผ ๊ฐ๊ฐ ์ง‘์ค‘ํ•ด์„œ ์ฒ˜๋ฆฌํ•˜๋Š” ๋กœ์ง์ด๋ผ ์‰ฝ๊ฒŒ ์ดํ•ด๊ฐ€ ๊ฐ€๋Š” ๊ฒƒ ๊ฐ™๋„ค์š”!

Comment thread climbing-stairs/togo26.js
pre2 = pre1 + pre2;
pre1 = temp;
}
return pre2;

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

์ฒซ ๋ฒˆ์งธ ํ’€์ด๊ฐ€ ์ ํ™”์‹์ด ํ•œ ๋ˆˆ์— ๋ณด์—ฌ์„œ ๊ฐ€๋…์„ฑ์€ ๋” ์ข‹์€ ๊ฑฐ ๊ฐ™๋„ค์š”!

๋‘๋ฒˆ ์งธ ํ’€์ด๋„ ๊ณต๊ฐ„๋ณต์žก๋„๊ฐ€ ์œ ๋ฆฌํ•ด์„œ ์ข‹์€๋ฐ์š”. pre1, pre2๊ฐ€ ๋‹จ์ˆœํžˆ ์„ ์–ธ ์ˆœ์„œ์— ๋”ฐ๋ผ 1, 2 ์ธ์ง€ ํ˜„์žฌ ํฌ์ธํ„ฐ ๊ธฐ์ค€์œผ๋กœ 1,2 ๋ฒˆ์งธ ์ „์ธ๊ฑด์ง€ ๊ฐ„๋‹จํ•œ ์ฃผ์„์ด ์žˆ์–ด๋„ ์ข‹์„ ๊ฑฐ ๊ฐ™์Šต๋‹ˆ๋‹ค!

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

์ข‹์€ ์˜๊ฒฌ ๊ฐ์‚ฌํ•ฉ๋‹ˆ๋‹ค! ๋ณ€์ˆ˜๋ช…์ด ์• ๋งคํ•˜๊ธดํ–ˆ๋Š”๋ฐ ๋‹ค์Œ๋ฒˆ์—๋Š” ์ฃผ์„์œผ๋กœ ๋ณด์กฐ ์„ค๋ช… ๋ถ™์—ฌ๋ณด๊ฒ ์Šต๋‹ˆ๋‹ค.

Comment thread 3sum/togo26.js
Comment on lines +28 to +57
var threeSum = function (nums) {
const result = [];

nums.sort((a, b) => a - b);

for (let i = 0; i < nums.length; i++) {
if (i > 0 && nums[i] === nums[i - 1]) continue;
if (nums[i] > 0) break;

let left = i + 1;
let right = nums.length - 1;

while (left < right) {
const sum = nums[left] + nums[right];
if (sum === -nums[i]) {
result.push([nums[i], nums[left], nums[right]]);
while (left < right && nums[left] === nums[left + 1]) left++;
while (left < right && nums[right] === nums[right - 1]) right--;
left++;
right--;
} else if (sum < -nums[i]) {
left++;
} else {
right--;
}
}
}

return result;
};

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

๋ง‰ํžˆ๋Š” ์ง€์  ์—†์ด ์ž˜ ์ฝํžˆ๋Š” ์ฝ”๋“œ์ธ ๊ฑฐ ๊ฐ™์Šต๋‹ˆ๋‹ค! ๐Ÿ‘

Comment thread valid-anagram/togo26.js
Co-authored-by: Hojeong Park <parkhj062@gmail.com>
Comment thread 3sum/togo26.js

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

๐Ÿท๏ธ ์•Œ๊ณ ๋ฆฌ์ฆ˜ ํŒจํ„ด ๋ถ„์„

  • ํŒจํ„ด: Two Pointers, Sorting, Greedy, Binary Search
  • ์„ค๋ช…: ์ฃผ์š” ๋กœ์ง์€ ์ •๋ ฌ ํ›„ ๋‘ ํฌ์ธํ„ฐ(left, right)๋ฅผ ํ™œ์šฉํ•ด ํ•ฉ์ด 0์ธ ์„œ๋กœ ๋‹ค๋ฅธ ์„ธ ์ˆ˜๋ฅผ ์ฐพ๋Š” ๋ฐฉ์‹์ด๋‹ค. ์ค‘๋ณต ์ œ๊ฑฐ๋ฅผ ์œ„ํ•ด ๋‘ ํฌ์ธํ„ฐ ์ด๋™ ์‹œ ๊ฐ’ ๋น„๊ต๋ฅผ ์ˆ˜ํ–‰ํ•œ๋‹ค. ๋”ฐ๋ผ์„œ Two Pointers ํŒจํ„ด์ด ํ•ต์‹ฌ์ด๋ฉฐ, ์ฝ”๋“œ์— ์ง์ ‘์ ์œผ๋กœ ๊ตฌํ˜„๋œ ์ •๋ ฌ๊ณผ ์กฐ๊ฑด ํ™•์ธ์œผ๋กœ ์ถ”๊ฐ€์ ์ธ ์ตœ์ ํ™”๊ฐ€ ํฌํ•จ๋œ๋‹ค.

๐Ÿ“Š ์‹œ๊ฐ„/๊ณต๊ฐ„ ๋ณต์žก๋„ ๋ถ„์„

์œ ์ € ๋ถ„์„ ์‹ค์ œ ๋ถ„์„ ๊ฒฐ๊ณผ
Time O(n^2) O(n^2) โœ…
Space O(n^2) O(1) โŒ

ํ”ผ๋“œ๋ฐฑ: ์ž…๋ ฅ ๋ฐฐ์—ด์„ ํ•œ ๋ฒˆ ์ •๋ ฌํ•˜๊ณ , ๊ฐ i์— ๋Œ€ํ•ด ์ขŒ์šฐ ํฌ์ธํ„ฐ๋ฅผ ์ด๋™์‹œํ‚ค๋ฉฐ ๊ฒฐ๊ณผ๋ฅผ ์ˆ˜์ง‘ํ•ฉ๋‹ˆ๋‹ค. ์ค‘๋ณต ์ œ๊ฑฐ๋ฅผ ์œ„ํ•ด i, left, right์˜ ์ค‘๋ณต ์นด์šดํŠธ๋ฅผ ์‹ ๊ฒฝ ์”๋‹ˆ๋‹ค.

๊ฐœ์„  ์ œ์•ˆ: ํ˜„์žฌ ๊ตฌํ˜„์ด ์ ์ ˆํ•ด ๋ณด์ž…๋‹ˆ๋‹ค.

Comment thread climbing-stairs/togo26.js

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

๐Ÿท๏ธ ์•Œ๊ณ ๋ฆฌ์ฆ˜ ํŒจํ„ด ๋ถ„์„

  • ํŒจํ„ด: Dynamic Programming, Monotonic Stack
  • ์„ค๋ช…: climbStairs๋Š” ํ”ผ๋ณด๋‚˜์น˜ ๊ณ„์—ด์˜ ํ•ฉ์œผ๋กœ ๊ตฌ์„ฑ๋˜๋Š” DP ๋ฌธ์ œ๋กœ ๊ฐ ๋‹จ๊ณ„์˜ ๊ฒฝ์šฐ์˜ ์ˆ˜๋ฅผ ์ด์ „ ๊ฐ’๋“ค๋กœ ๊ณ„์‚ฐํ•œ๋‹ค. ๋ฐ˜๋ณต์„ ํ†ตํ•œ ์ƒํƒœ ์ „์ด๊ฐ€ ํ•ต์‹ฌ์ด๋ฉฐ, ์ตœ์  ๋ถ€๋ถ„๊ตฌ์กฐ๋ฅผ ์ด์šฉํ•œ DP ํŒจํ„ด์œผ๋กœ ๋ถ„๋ฅ˜๋œ๋‹ค.

๐Ÿ“Š ์‹œ๊ฐ„/๊ณต๊ฐ„ ๋ณต์žก๋„ ๋ถ„์„

์œ ์ € ๋ถ„์„ ์‹ค์ œ ๋ถ„์„ ๊ฒฐ๊ณผ
Time O(n) O(n) โœ…
Space O(n) O(n) โœ…

ํ”ผ๋“œ๋ฐฑ: ์ฒซ ๊ตฌํ˜„์€ ๋ฐฐ์—ด์„ ์ด์šฉํ•œ DP์ด๊ณ , ๋‘ ๋ฒˆ์งธ ๊ตฌํ˜„์€ ์ƒ์ˆ˜ ๊ณต๊ฐ„์œผ๋กœ ์ตœ์ ํ™”ํ–ˆ์Šต๋‹ˆ๋‹ค.

๊ฐœ์„  ์ œ์•ˆ: ๋ฉ”๋ชจ๋ฆฌ ์‚ฌ์šฉ์„ ์ค„์ด๋Š” ๋ฐฉํ–ฅ์€ ์ด๋ฏธ ๋ฐ˜์˜๋˜์–ด ์žˆ์Šต๋‹ˆ๋‹ค.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

๐Ÿท๏ธ ์•Œ๊ณ ๋ฆฌ์ฆ˜ ํŒจํ„ด ๋ถ„์„

  • ํŒจํ„ด: Two Pointers, Dynamic Programming, Hash Map / Hash Set
  • ์„ค๋ช…: ๋‘ ํ’€์ด ๋ชจ๋‘ ๋ฐฐ์—ด์˜ ๊ฐ ์›์†Œ์— ๋Œ€ํ•ด ๋‹ค๋ฅธ ์›์†Œ์˜ ๊ณฑ์˜ ๋ˆ„์ ๊ฐ’์„ ๋ฏธ๋ฆฌ ๊ณ„์‚ฐํ•ด ๊ฒฐ๊ณผ๋ฅผ ๊ตฌํ•œ๋‹ค. ์™ผ์ชฝ ๋ˆ„์ ๊ณฑ๊ณผ ์˜ค๋ฅธ์ชฝ ๋ˆ„์ ๊ณฑ์˜ ๊ณฑ์œผ๋กœ ๊ฐ ์œ„์น˜์˜ ๊ฒฐ๊ณผ๋ฅผ ์–ป๋Š” ๊ธฐ๋ฒ•์€ DP์™€ ๋‘ ํฌ์ธํ„ฐ์˜ ๋ฌถ์Œ์œผ๋กœ ๋ณผ ์ˆ˜ ์žˆ๋‹ค. ๋˜ํ•œ ๊ณต๊ฐ„ ์ ˆ์•ฝ ๋ฒ„์ „์€ ํ•œ ๋ฐฐ์—ด์— ๋ˆ„์ ๊ฐ’์„ ๊ฐฑ์‹ ํ•˜๋Š” ํ˜•ํƒœ๋กœ ๊ตฌํ˜„๋œ๋‹ค.

๐Ÿ“Š ์‹œ๊ฐ„/๊ณต๊ฐ„ ๋ณต์žก๋„ ๋ถ„์„

์œ ์ € ๋ถ„์„ ์‹ค์ œ ๋ถ„์„ ๊ฒฐ๊ณผ
Time O(n) O(n) โœ…
Space O(n) O(n) โœ…

ํ”ผ๋“œ๋ฐฑ: ๋‘ ํŒจ์Šค์œผ๋กœ ์ขŒ์šฐ ๊ณฑ์„ ๊ตฌํ•˜๊ณ  ์ตœ์ข…์ ์œผ๋กœ ๊ณฑ์„ ๊ณ„์‚ฐํ•ฉ๋‹ˆ๋‹ค. ์ถ”๊ฐ€ ๋ฐฐ์—ด ์‚ฌ์šฉ์œผ๋กœ ์ง๊ด€์ ์ž…๋‹ˆ๋‹ค.

๊ฐœ์„  ์ œ์•ˆ: ์ถ”๊ฐ€ ๋ฐฐ์—ด ์‚ฌ์šฉ์„ ์ค„์ด๊ณ  ๋ฌด์‹œ ๊ฐ€๋Šฅํ•œ ๊ณต๊ฐ„ ์ตœ์ ํ™”๋„ ๊ณ ๋ ค ๊ฐ€๋Šฅ.

Comment thread valid-anagram/togo26.js

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

๐Ÿท๏ธ ์•Œ๊ณ ๋ฆฌ์ฆ˜ ํŒจํ„ด ๋ถ„์„

  • ํŒจํ„ด: Hash Map / Hash Set, Two Pointers, Dynamic Programming
  • ์„ค๋ช…: ๋‘ ๋ฌธ์ž์—ด์˜ ๋ฌธ์ž ๋นˆ๋„๋ฅผ ๋น„๊ตํ•˜๊ธฐ ์œ„ํ•ด ํ•ด์‹œ๋งต์œผ๋กœ ์นด์šดํŠธํ•˜๋Š” ๋ถ€๋ถ„์ด ํ•ต์‹ฌ์ด๋ฉฐ, ๊ฐ ๋ฌธ์ž ๋“ฑ์žฅ ํšŸ์ˆ˜๋ฅผ ๋น„๊ตํ•˜๋Š” ๋ฐฉ์‹์€ ํ•ด์‹œ ๋งต ํŒจํ„ด์— ์†ํ•ฉ๋‹ˆ๋‹ค. ๋˜ํ•œ ์ž…๋ ฅ ๊ธธ์ด๊ฐ€ ๊ฐ™์Œ์„ ํ™•์ธํ•˜๊ณ  ๋‘ ํ•ด์‹œ๋งต์˜ ๊ฐ’์„ ๋น„๊ตํ•˜๋Š” ํ๋ฆ„์€ ํŒจํ„ด์˜ ๋Œ€ํ‘œ์ ์ธ ํ™œ์šฉ ์˜ˆ๋กœ ๊ฐ„์ฃผ๋ฉ๋‹ˆ๋‹ค. ๋‹ค๋งŒ ํŠน์ • ํˆฌํฌ์ธํ„ฐ๋‚˜ ์Šฌ๋ผ์ด๋”ฉ ์œˆ๋„์šฐ๋ณด๋‹ค๋Š” ํ•ด์‹œ ๋งต ๊ธฐ๋ฐ˜์˜ ๋น„๊ต๊ฐ€ ์ฃผ๋ฅผ ์ด๋ฃน๋‹ˆ๋‹ค.

๐Ÿ“Š ์‹œ๊ฐ„/๊ณต๊ฐ„ ๋ณต์žก๋„ ๋ถ„์„

์œ ์ € ๋ถ„์„ ์‹ค์ œ ๋ถ„์„ ๊ฒฐ๊ณผ
Time O(nlogn) O(n log n) โœ…
Space O(nlogn) O(n) โŒ

ํ”ผ๋“œ๋ฐฑ: ์ฒซ ๋ฒˆ์งธ ๊ตฌํ˜„์€ ์ •๋ ฌ์œผ๋กœ ๋‹จ์ˆœํ•˜๊ณ  ๋‘ ๋ฒˆ์งธ ๊ตฌํ˜„์€ ํ•ด์‹œ๋งต์œผ๋กœ ์„ ํ˜• ์‹œ๊ฐ„์— ๋น„๊ตํ•ฉ๋‹ˆ๋‹ค.

๊ฐœ์„  ์ œ์•ˆ: ๋Œ€๋ถ€๋ถ„์˜ ๊ฒฝ์šฐ ํ•ด์‹œ๋งต ๋ฒ„์ „์ด ๋” ์ตœ์ ํ™”์— ์œ ๋ฆฌํ•ฉ๋‹ˆ๋‹ค.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

๐Ÿท๏ธ ์•Œ๊ณ ๋ฆฌ์ฆ˜ ํŒจํ„ด ๋ถ„์„

  • ํŒจํ„ด: Binary Search, Depth-First Search, Binary Tree
  • ์„ค๋ช…: ๋ฃจํŠธ-์ขŒ์šฐ ์ž์‹ ๋…ธ๋“œ์˜ ๊ฐ’ ๋ฒ”์œ„๋ฅผ ์žฌ๊ท€๋กœ ์ถ”์ ํ•˜๋ฉฐ BST ์กฐ๊ฑด์„ ๋งŒ์กฑํ•˜๋Š”์ง€ ๊ฒ€์‚ฌํ•˜๋ฏ€๋กœ, ์ด ์ฝ”๋“œ๋Š” ์ด์ง„ ํƒ์ƒ‰ ํŠธ๋ฆฌ ๊ฒ€์‚ฌ์™€ ๊นŠ์ด ์šฐ์„  ํƒ์ƒ‰์˜ ์กฐํ•ฉ์œผ๋กœ ๋ถ„๋ฅ˜๋ฉ๋‹ˆ๋‹ค. ์ตœ์†Œ/์ตœ๋Œ€ ๊ฒฝ๊ณ„ ๊ฐ’์„ ์ด์šฉํ•œ ํƒ์ƒ‰์œผ๋กœ ํŒจํ„ด์„ ๋งค์นญํ•ฉ๋‹ˆ๋‹ค.

๐Ÿ“Š ์‹œ๊ฐ„/๊ณต๊ฐ„ ๋ณต์žก๋„ ๋ถ„์„

์œ ์ € ๋ถ„์„ ์‹ค์ œ ๋ถ„์„ ๊ฒฐ๊ณผ
Time O(n) O(n) โœ…
Space O(n) O(h) โŒ

ํ”ผ๋“œ๋ฐฑ: ๊ฐ ๋…ธ๋“œ๋ฅผ ์ •ํ™•ํ•œ ๋ฒ”์œ„ ์•ˆ์— ์žˆ๋Š”์ง€ ํ™•์ธํ•˜๋ฉฐ ์žฌ๊ท€์ ์œผ๋กœ ์ž์‹๋“ค์„ ๊ฒ€์‚ฌํ•ฉ๋‹ˆ๋‹ค.

๊ฐœ์„  ์ œ์•ˆ: ์Šคํƒ ๊ธฐ๋ฐ˜์˜ ๊ตฌํ˜„์œผ๋กœ๋„ ๊ณต๊ฐ„ ๋ณต์žก๋„๋ฅผ ์ œ์–ด ๊ฐ€๋Šฅ.

@togo26 togo26 merged commit db714c6 into DaleStudy:main Jul 4, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Development

Successfully merging this pull request may close these issues.

2 participants