โœ๏ธ

Linear search

Easy๐Ÿท๏ธ Searching๐Ÿ“‚ Algorithmic Thinking
๐Ÿงฉ The problem

Given SET LIST = [4, 8, 15, 16, 23, 42], TAKE a TARGET and DISPLAY its index, or -1 if it isn’t there.

Examples

  • Input: 15 โ†’ 2
  • Input: 99 โ†’ -1

โœ๏ธ Write your pseudocode

Press Run to watch it step by step, and Run tests to check it against every test case.

โ† All practice problems