Search in Rotated Sorted Array | Leetcode 33 Solution

Searching for an element in a rotated sorted array is a common coding problem that can appear in technical interviews. It combines concepts of array manipulation and binary search, making it an essential topic to master. In this blog post, we will explore solutions for Search in Rotated Sorted Array from naive to optimal, providing … Read more

Longest Common Prefix | Leetcode 14 Solution

The Longest Common Prefix problem on Leetcode is a classic string manipulation problem. Here’s the problem statement: Problem Statement: Write a function to find the longest common prefix string amongst an array of strings.If there is no common prefix, return an empty string “”. Examples: Example 1: Example 2: Naive Solution: Compare Characters Iteratively Approach: … Read more

Master Binary Search Algorithm- Why and How | Implementation

Binary Search Algorithm

In the previous article , we learnt about the searching algorithms and two types of searching algorithms. We learnt about Linear Search algorithm. In this article, we will learn about another important searching algorithm called Binary Search algorithm. About Binary Search Algorithm Binary search is an efficient algorithm designed to locate a specific value within … Read more