Java Binary Search Algorithm Explained

DSA with Java.... Today I learnt about BINARY SEARCH.. Binary search refers to finding the position of an element in a sorted array. Half of the array is disregarded during each step. This search works on datasets that are sorted first. It works more efficiently with large data sets with a runtime complexity of O(log n) i.e the larger the dataset, the more efficient it becomes. There is an in built binary search function in Java and I tried creating a function to understand how the logic works. Next up: interpolation search... cheers 🥂 #dsa #softwareengineer #java #binarysearch

  • No alternative text description for this image

To view or add a comment, sign in

Explore content categories