![]() ![]() |
| |||||||||
| Hotspots: Slides and Code TA Corner Comments? Announcements FAQ Static Webspace | ||||||||||
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() |
| Think linear vs. binary. Mark Guzdial |
| Yes, but that's not really why. Binary search is sometimes called 'binary chop' because you chop the set to be searched into two parts based on where you know the target item to be and search only in that half. It's not that there are ranges: it's that the ranges define "halves" (not really halves, because they might be different lengths – but there are two of them) and you successively divide up the search space by chopping it in two and only looking in the correct half. Colin Potts |
| Scaling is a goal, not an algorithm for getting there. Searching is also a gola, but there's more than one way to search. Any given search function is implementing a single algorithm. Mark Guzdial |
| Yes, both of the programs in part A are implementing a sampling algorithm, and both of the algorithms in part B are implementing a linear search algorithm. They're definitely not sorting algorithms – sorts change the order of data, but none of these programs do that. Yes, Jennifer, any program is implementing some algorithm, but there are many different programs that implement the same algorithm. That's the point of this problem. Mark Guzdial |
| Now, can you explain a sampling algorithm and a linear search "in English" – explain what it's doing, apart from a program implementation? That's the other part of what the problem is asking you to do. Mark Guzdial |
| Really nice, Brittany! Mark Guzdial |