YouTube

Got a YouTube account?

New: enable viewer-created translations and captions on your YouTube channel!

English subtitles

← Implementing Removing Mean Friends - Intro to Java Programming

Get Embed Code
5 Languages

Showing Revision 5 created 07/06/2017 by Dejan Trajkovic.

  1. Now it's your turn to code the Remove Mean Friends method in BlueJ. I'll show
  2. you some working pseudocode, but feel free to try it yourself first, and then
  3. come back to look at the pseudocode. We'll create a variable i, which starts at
  4. the beginning of the friends list. Now, while i is a valid index of friends, we
  5. either remove the i-th friend or increment i. We remove the ith friend if the
  6. ith friend doesn't have this person as a friend. And otherwise we increment i.
  7. Cay would like you to pay close attention to the answer to this question, even
  8. if you get it right. This algorithm is going to be important again, later in
  9. the course.