![]() ![]() |
| |||||||||
| This page removed for FERPA compliance | ||||||||||
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() |
| Cool! If I asked you to name a program that implements a copying algorithm (copying something from one data structure to another) or a binary search, could you name one? Mark Guzdial |
| BTW (following up on that question above): Note that the questions say not only to name them, but to describe them in English. (Also recall that these weren't the only two algorithms we studied – binary search is also fair game.) Mark Guzdial |
| Your description of the sampling algorithm just sounds like a copying algorithm. It does something different than just copying. The linear and binary search ones are pretty good, but the binary search can split by halves REMOVED than twice. Mark Guzdial |
| To increase the size of a picture, you take every pixel twice. To decrease, you skip every other pixel. To half the frequency of a sound, you take every pixel twice. To double the frequency, you skip every other sample. Perhaps there's a pattern here? Mark Guzdial |
| That would be outright wrong. Sampling doesn't change the source value. It changes the source INDEX. It's not the value that changes, but WHICH values you're copying. Read over the code again and see if you see that. Mark Guzdial |
A) This is a sampling algorithm. A sampling algorithm: 1. Gets an index to a source 2. Gets an index to a target 3. For all the elements that we want to process: 1) Copy an element from the source at the integer value of the source index to the target at the target index 2) Increment the source index by some number a) for sound:
| Very nice on sampling – REMOVED detail than needed, but definitely what I mean by "in English." Binary search: Missing a key detail about "halves." Mark Guzdial |
| REMOVEDre – splicing and basic compositing of a picture into a canvas is copying – you move the samples or pixels from one place to another, one after the other, skipping none, and modifying none. Mark Guzdial |
| Yes, a sampling algorithm is a kind of copying algorithm. But a sampling algorithm does NOT do a one-for-one copy. No, it doesn't alter any individual pixel or sample. But by skipping or doubling the individual pixel/sample copies, you end up with a new result that's bigger or smaller, higher or lower, than the original. Mark Guzdial |
| clearRed isn't sampling or copying. Nor is it linear search nor binary search. We haven't named EVERY algorithm. Mark Guzdial |
| Sounds right to me. Mark Guzdial |