Thursday, July 30, 2009

What kind of loop would you use in the Bubble Sort or Linear Search method in AP Computer Science A?

I had a quiz over it and I was absent the day we learned about it and I got a 0. Could anybody explain it? Computer Science is so confusing. I have a sucky teacher.

What kind of loop would you use in the Bubble Sort or Linear Search method in AP Computer Science A?
For a bubble sort, you use a set of for loops to keep running through the list comparing adjacent items, and then swapping them if necessary.





For a linear search, your just going through the list in sequence. So a 'for' loop would be the obvious choice. Start with the first item in the list and keep looking through the list one item at a time until you find the one you were looking for.





Check the following links for lots more information.
Reply:well i usually use the bubblicious loop i find it to be the best and it blows away all it's competation! as far as comp. science goes well what is that a computer that runs on test tubes and bubble bracetts?


No comments:

Post a Comment