Suppose a sorted array is rotated at some pivot unknown to you beforehand. (i.e., 0 1 2 4 5 6 7 might become 4 5 6 7 0 1 2). You are given a target valu……
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 o……
Follow up for "Find Minimum in Rotated Sorted Array": What if duplicates are allowed? Would this affect the run-time complexity? How and why? Suppose a ……
Given a positive integer num, write a function which returns True if num is a perfect square else False. Note: Do not use any built-in library function suc……
We are playing the Guess Game. The game is as follows: I pick a number from 1 to n. You have to guess which number I picked. Every time you gu……
Problem Jane plans to open a flower shop in the local flower market. The initial cost includes the booth license, furnishings and decorations, a truc……