Skip to content

Latest commit

 

History

11 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

  1. Set largest = arr[0]
  2. Loop through the array
  3. If arr[i] > largest, update largest
  4. Print largest.

The above optimal solution's time complexity reduces to o(n) and space complexity to o(1). However,it can also be solved by Brute force technique, which sorts the array in ascending order. The element at the last index position is the largest number. But its time complexity is o(nlog(n)) and space complexity is o(1), which is inefficient.

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

1 watching

Forks

Releases

Packages

Contributors

Languages