Skip to content

Commit 17ec148

Browse files
committed
update time and space complexity
1 parent 7c5d157 commit 17ec148

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

โ€Žspiral-matrix/mmyeon.tsโ€Ž

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,11 @@
44
* ์ ‘๊ทผ ๋ฐฉ๋ฒ• :
55
* - right -> bottom -> left -> top ์ˆœ์„œ๋กœ ์ง„ํ–‰ํ•˜๋ฉด์„œ ๊ฒฝ๊ณ„ ์—…๋ฐ์ดํŠธ ์ฒ˜๋ฆฌ
66
*
7-
* ์‹œ๊ฐ„๋ณต์žก๋„ : O(m x n)
8-
* - m x n ํ–‰๋ ฌ์˜ ๋ชจ๋“  ์ˆซ์ž ๋ฐฉ๋ฌธํ•˜๋‹ˆ๊นŒ O(m x n)
7+
* ์‹œ๊ฐ„๋ณต์žก๋„ : O(n)
8+
* - n์€ ํ–‰๋ ฌ์˜ ๋ชจ๋“  ์ˆซ์ž๋กœ, ๋ชจ๋“  ์ˆซ์ž๋ฅผ ํ•œ ๋ฒˆ์”ฉ ๋ฐฉ๋ฌธํ•˜๋ฏ€๋กœ O(n)
99
*
1010
* ๊ณต๊ฐ„๋ณต์žก๋„ : O(n)
11-
* - ์ˆซ์ž ๊ธธ์ด๋งŒํผ ๋ฐฐ์—ด์— ๋‹ด์Œ *
11+
* - ๋ชจ๋“  ์ˆซ์ž๋ฅผ ์ €์žฅํ•˜๊ธฐ ์œ„ํ•ด์„œ ๋ฐฐ์—ด ์‚ฌ์šฉํ•˜๋ฏ€๋กœ O(n)
1212
*/
1313

1414
function spiralOrder(matrix: number[][]): number[] {

โ€Žvalid-parentheses/mmyeon.tsโ€Ž

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
*
1010
* ๊ณต๊ฐ„๋ณต์žก๋„ : O(k)
1111
* - pairs ๊ฐ์ฒด ๊ณ ์ •๋œ ํฌ๊ธฐ๋กœ ์ €์žฅ O(1)
12-
* - stack์— ์—ด๋ฆฐ ๊ด„ํ˜ธ ๊ฐœ์ˆ˜๋งŒํผ ๋‹ด๊ธฐ๋‹ˆ๊นŒ O(k)
12+
* - k๋Š” ์—ด๋ฆฐ ๊ด„ํ˜ธ ๊ฐœ์ˆ˜, stack์— ์ „์ฒด ๋ฌธ์ž์—ด ์ค‘ k๋งŒํผ๋งŒ ๋‹ด๊ธฐ๋‹ˆ๊นŒ O(k)
1313
*/
1414

1515
function isValid(s: string): boolean {

0 commit comments

Comments
ย (0)