Présentation du problème

Binary Search


Perform a binary search in a sorted array.

hard
Generate Goal Tree Build Plan

Goal Tree Generated by LLM

{
  "children": [
    {
      "children": [
        {
          "children": [],
          "goal": "Identify the middle index of the current interval"
        }
      ],
      "goal": "Determine the search interval boundaries"
    },
    {
      "children": [
        {
          "children": [],
          "goal": "Adjust interval based on comparison"
        },
        {
          "children": [],
          "goal": "Check for termination condition"
        }
      ],
      "goal": "Compare target with middle element"
    }
  ],
  "goal": "Perform a binary search to locate a target value in a sorted array"
}
    

Generated Goals

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

  • Determine the search interval boundaries
  • Explore the use of hash tables for constant-time lookups.
  • Understand how to perform a linear search in an unsorted array.
  • Identify the middle index of the current interval
  • Learn the principles of sorting algorithms such as quicksort.
  • Adjust interval based on comparison
  • Compare target with middle element
  • Check for termination condition