Skip to content

Commit b878af0

Browse files
authored
Update Time_Complexity.md
Modify isPrime function
1 parent 3200de1 commit b878af0

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

website/content/ChapterOne/Time_Complexity.md

+1
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,7 @@ void hello (int n){
4444
4545
```c
4646
bool isPrime (int n){
47+
if (num <= 1) return false;
4748
for( int x = 2 ; x * x <= n ; x ++ )
4849
if( n % x == 0 )
4950
return false;

0 commit comments

Comments
 (0)