University of Lethbridge - CPSC
linear_search()
Assignment 1 - Movie2 - SM 25What 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.
Members only
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
- 3,000 AI tutor tokens / month
- Personal SQL database (3 MB)
- Progress tracking
Cancel any time.