package h06.problems;

import org.tudalgo.algoutils.student.annotation.StudentImplementationRequired;

import static org.tudalgo.algoutils.student.Student.crash;

public class LinearSearch {

    /**
     * Recursively searches for a target in an array using linear search.
     *
     * @param arr    the array to search in
     * @param target the target to search for
     * @return the index of the target in the array, or -1 if the target is not found
     */
    @StudentImplementationRequired
    public static int linearSearchRecursive(int[] arr, int target) {
        return crash(); // TODO: H2.1 - remove if implemented
    }

    /**
     * Recursively searches for a target in an array using linear search.
     *
     * @param arr    the array to search in
     * @param target the target to search for
     * @param index  the index to start searching from
     * @return the index of the target in the array, or -1 if the target is not found
     */
    @StudentImplementationRequired
    public static int linearSearchRecursiveHelper(int[] arr, int target, int index) {
        return crash(); // TODO: H2.1 - remove if implemented
    }

    /**
     * Iteratively searches for a target in an array using linear search.
     *
     * @param arr    the array to search in
     * @param target the target to search for
     * @return the index of the target in the array, or -1 if the target is not found
     */
    @StudentImplementationRequired
    public static int linearSearchIterative(int[] arr, int target) {
        return crash(); // TODO: H2.2 - remove if implemented
    }
}
