Function

Gst-1.0Gstutil_array_binary_search

  • Searches inside array for search_data by using the comparison function search_func. array must be sorted ascending.

    As search_data is always passed as second argument to search_func it's not required that search_data has the same type as the array elements.

    The complexity of this search function is O(log (num_elements)).

    Parameters

    • array: any

      the sorted input array

    • num_elements: number

      number of elements in the array

    • element_size: number

      size of every element in bytes

    • search_func: CompareDataFunc

      function to compare two elements, search_data will always be passed as second argument

    • mode: Gst.SearchMode

      search mode that should be used

    • Optionalsearch_data: any

      element that should be found

    Returns any

    The address of the found element or null if nothing was found