CJCoding With Joseph
15free / daySign inCreate account

University of Lethbridge - CPSC

search_and_report()

Assignment 1 - Movie2 - SM 25

What is this function?

This function runs a search (either linear or binary) and prints out the result in a clean format.

It doesn’t do any searching itself. Instead, it calls a search function that you pass in. Either linear_search() or binary_search(). Then prints what it returns.

This way, you don’t need to write the same display logic twice.

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.