Présentation du problème

Linear Search


Check whether a value exists in an array.

easy
Generate Goal Tree Build Plan

Goal Tree Generated by LLM

{
  "children": [
    {
      "children": [
        {
          "children": [],
          "goal": "Check if array is sorted"
        }
      ],
      "goal": "Analyze array characteristics"
    },
    {
      "children": [
        {
          "children": [],
          "goal": "Choose linear search if unsorted, binary search if sorted"
        }
      ],
      "goal": "Select search strategy"
    },
    {
      "children": [],
      "goal": "Validate presence result"
    }
  ],
  "goal": "Determine if a target value is present in the array"
}
    

Generated Goals

Mixed goals generated by the LLM (correct + distractors).

  • Analyze array characteristics
  • Choose linear search if unsorted, binary search if sorted
  • Check if array is sorted
  • Write unit tests to verify the correctness of the existence check function
  • Design a data structure that allows efficient lookup of values in the array
  • Select search strategy
  • Validate presence result
  • Create a user interface that displays the array and highlights the searched value