# All posts tagged search

Problem statement A time series is a series of data points indexed in time order. They are commonly used in the financial world, especially in stock markets. In this challenge you are working with a time series of stock prices. You are given historical records where the stock at time . . . Read more

Problem statement Given an array of integers sorted in ascending order, find the starting and ending position of a given target value. If the target is not found in the array, return . Sample input [5, 7, 7, 8, 8, 10] 8 Sample output [3, 4] Solution class Solution(object): def . . . Read more

Problem statement Suppose an array sorted in ascending order is rotated at some pivot unknown to you beforehand. (i.e., might become ). You are given a target value to search. If found in the array return its index, otherwise return . You may assume no duplicate exists in the array. . . . Read more

Problem statement Given a sorted array of integers, find the starting and ending position of a given target value. Your algorithm’s runtime complexity must be in the order of . If the target is not found in the array, return . For example, given and target value 8, return . . . . Read more

Problem statement Given the root of a Binary Search Tree (BST), convert the BST to a sorted doubly linked list in-place. BST is formed only on left and right pointers. prev and next pointers are unassigned initially. Initialise prev and next pointers of Node for creating a doubly-linked list. BST . . . Read more

The Boyer–Moore string search algorithm is an efficient string searching algorithm that is the standard benchmark for practical string search literature. For instance, GNU grep uses the Boyer-Moore algorithm. For a full explanation of the algorithm please refer to Wikipedia.

The Aho–Corasick algorithm is a string searching algorithm invented by Alfred V. Aho and Margaret J. Corasick. For a full explanation of the algorithm please refer to Wikipedia.