0

Why do I need to implement sort for find.c if by the task I should be only using linear search which just compares each value from 0 to maximum? What is the reason for the sort?

Thank you.

4
  • you need to implement a sorting function because sorting is a fundamental problem in computer science and because you didn't get to finish the pset specification page yet :)
    – kzidane
    Commented Nov 21, 2015 at 12:07
  • I still don't get it. What is the reason for using sort to implement linear search ? It doesn't require sort as i understand it. If it was binary search, for example, the list of values should be sorted. But why for linear search?
    – ruthless_g
    Commented Nov 21, 2015 at 12:47
  • sorting isn't needed for linear search. it's needed for binary search which you're gonna be asked to implement later in the specs.
    – kzidane
    Commented Nov 21, 2015 at 13:21
  • Thanks. Just implemented linear search and didn't bother for the sort for now :)
    – ruthless_g
    Commented Nov 21, 2015 at 14:37

0

You must log in to answer this question.

Browse other questions tagged .