Skip to content

Latest commit

 

History

History
6 lines (5 loc) · 215 Bytes

max-min-unsorted.md

File metadata and controls

6 lines (5 loc) · 215 Bytes

6. Max Min unsorted array

Iterate through the array, doing a linear search takes O(n) and keep a min pointer and max pointer, both being updated as needed

  • Time complexity --> O(n)
  • Space complexity --> O(1)