Is the overall time complexity of an algorithm effected if it calls another algorithm to perform it's functionality?

I am trying to design an algorithm with O(1) time complexity (TC) that returns a value from an array that ISN'T the smallest value. I understand that searching the array and comparing it's elements to find the smallest will give the algorithm linear O(n) TC so that wouldn't work.

What I want to know is, if I write a separate method that uses a sorting algorithm to sort the array first and then return the smallest, will this effect the TC of the algorithm I am trying to design?

Here's my...

Read More »

By: StackOverFlow - Tuesday, 6 November

Related Posts