Tag Archives: Binary Search

NP Complete Problems

Introduction One of the – confusing – topics in Algorithm design is the concept of NP completeness. If you search the topic on the internet you will probably find tons of articles and lectures on the subject however in this …

Read more »

Understanding Recursion

What is Recursion: Please Bear with me This is going to be a short and technical article so please bear with my bad English and writing style. Language is also a mean of communication and sometimes it fails to convey …

Read more »

Iterative Binary Search Function

Problem Given an array of positive integers. Write an iterative version of binary search to find an element in the array Solution Binary search can be easily implemented using recursion due to the divide and conquer nature of the algorithm …

Read more »

Logn 2 Dimensional Array Binary Search

Problem Given a square two dimensional integer array of size (n). Both rows and columns are sorted in ascending order. Give an algorithm to search for a particular element in the array in O(Log(n)) time complexity. Assume the array has …

Read more »

Two Dimensional Array Binary Search

Problem Given a square two dimensional integer array of size (n). Both rows and columns are sorted in ascending order. Write an efficient code to search for a particular element in the array. Assume the array has no duplicates. Solution …

Read more »