Hoarding programming problems for you!

Looking for good programming challenges?

Use the search below to find our solutions for selected questions!

All posts tagged search

Time series queries challenge

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

Search for a range challenge

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

Sample output

Solution

Search in rotated sorted array challenge

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

Search for a range challenge

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

Binary Search Tree to sorted doubly-linked list

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

Boyer–Moore string search algorithm

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.

Aho-Corasick string search algorithm

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.