Skip to content

Commit 94eb325

Browse files
committed
wrote Time/Space Complexities for each algorithm
1 parent c86130a commit 94eb325

File tree

5 files changed

+10
-0
lines changed

5 files changed

+10
-0
lines changed

best-time-to-buy-and-sell-stock/wclee2265.cpp

+2
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
11
// https://leetcode.com/problems/best-time-to-buy-and-sell-stock/
2+
// Time Complexity : O(n)
3+
// Space Complexity : O(1)
24

35
class Solution {
46
public:

contains-duplicate/wclee2265.cpp

+2
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
11
// https://leetcode.com/problems/contains-duplicate/
2+
// Time Complexity : O(n)
3+
// Space Complexity : O(n)
24

35
class Solution {
46
public:

two-sum/wclee2265.cpp

+2
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
11
// https://leetcode.com/problems/two-sum/
2+
// Time Complexity : O(nlogn)
3+
// Space Complexity : O(n)
24

35
class Solution {
46
public:

valid-anagram/wclee2265.cpp

+2
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
11
// https://leetcode.com/problems/valid-anagram/
2+
// Time Complexity : O(n)
3+
// Space Complexity : O(1)
24

35
class Solution {
46
public:

valid-palindrome/wclee2265.cpp

+2
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
11
// https://leetcode.com/problems/valid-palindrome/
2+
// Time Complexity : O(n)
3+
// Space Complexity : O(n)
24

35
class Solution {
46
public:

0 commit comments

Comments
 (0)