I'm confused about how to do big-O analysis for the following problem -
find an element from an array of integers. ( an example problem)
my solution
- sort the array using bubble sort ( n^2 )
- binary search on the array for a given element (logn)
now the big-O for this is n^2 or n^2 + logn ? Should we only consider the higher term ?