CJCoding With Joseph
15free / daySign inCreate account

linear_search()

Assignment 1 - Movie2 - SM 25

What is this function?

This function searches through the list of movies one item at a time to see if the title the user entered matches any of the titles in the list.

It uses a simple loop that goes from the beginning to the end of the vector. If it finds a match, it stores the matching year and returns true. If it doesn’t find the title, it returns false.

Keep reading this lesson

You've reached the end of the free preview. Unlock the rest of this lesson plus 27 more lessons in University of Lethbridge - CPSC.

  • Unlimited coding questions
  • Unlimited access to all classroom material
  • Weekly live call for questions and guidance
  • Mock exams marked by hand, with feedback
  • 3,000 AI tutor tokens / month
  • Personal SQL database (3 MB)
  • Progress tracking

Cancel anytime.