RE: My job hunt progress - EC2! 03-04-2018, 07:23 AM
#18
(03-04-2018, 03:23 AM)Ender Wrote:(03-04-2018, 02:43 AM)phyrrus9 Wrote:(03-04-2018, 01:41 AM)Ender Wrote: Then what if nlogn < 5? Your algorithm would be worse than nlogn there too.
Code:if (list_size <= 5)   memcpy(largest, list, list_size * sizeof(int); else {   // actual algo goes here } for (i = 0; i < 5 && i < list_size; ++i) // not part of the algo, this is just printing the results   printf("%d\n", largest[i]);
In that case, then I could do the same...
Remember, solving the problem is only one part of the question, and it's not a very significant one

























![[+]](https://sinister.ly/images/modern/collapse_collapsed.png)