![]() ![]() |
| |||||||||
| Hotspots: Slides and Code TA Corner Comments? Announcements FAQ Static Webspace | ||||||||||
![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() |
| Describe what the it does in english and include the running time of the algorithm (Big O). Angela Liang |
| Are they resizing them bigger or smaller? And are you sure that each pixel is only being looked at once? Kelly Lyons |
| "copyBarbsFaceLarger(): this is a function that operates much like half(filename) except there is no input in the function copyBarbsFaceLarger() and it is dealing with pictures instead of sound. The program first takes in a picture barb and a blank picture called canvas." You first say that it takes in no input, and then say that it does. I am asuming you are meaning that it creates a picture from a file inside the function, but you should be more careful with your words. Mistakes like this make it hard to tell sometimes if you really understand things or if you are just guessing. Kelly Lyons |
| You are close to the answer, but you need to look back at how you are describing what the target and source Index do... The target and source are the same file to begin with in the case of the sound and not in the picture, and the program is taking certain parts from the source and putting them into the target, the question is how–the targetIndex is not automatically twice as fast as the sourceIndex though (because for one they are the same file, and in the second program the file is not a sound)... You don't have to be quite this descriptive as to what each program does, you can be a little more concise in that they both perform the same type of operation on differnt kinds of files. Summer McWilliams |
| For the second set of two programs, they are O(n) becuase the first goes through each item in the list once and the second goes through each pixel once. For the first one, how many times is each pixel or sound sample visited? Is it constant and not dependant on the number of pixels or samples? In this instance, the answer would be O(n). Is it a number of times dependant on the number of pixels (increase the number of pictures, and you visit each pixel more times)? This would lead to an O(n^2) or O(nlog(n)) or whatever dependant on the relation. Kelly Lyons |