上一页 1 2 3 4 5 6 7 8 ··· 23 下一页
摘要: The structure of Segment Tree is a binary tree which each node has two attributesstart and end denote an segment / interval. start and end are both in 阅读全文
posted @ 2016-04-05 17:51 哥布林工程师 阅读(98) 评论(0) 推荐(0) 编辑
摘要: Follow up for "Search in Rotated Sorted Array":What if duplicates are allowed? Would this affect the run-time complexity? How and why? Write a functio 阅读全文
posted @ 2016-04-05 17:50 哥布林工程师 阅读(127) 评论(0) 推荐(0) 编辑
摘要: 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 va 阅读全文
posted @ 2016-04-05 17:41 哥布林工程师 阅读(125) 评论(0) 推荐(0) 编辑
摘要: Given a sorted array of n integers, find the starting and ending position of a given target value. If the target is not found in the array, return [-1 阅读全文
posted @ 2016-04-05 17:11 哥布林工程师 阅读(139) 评论(0) 推荐(0) 编辑
摘要: Write an efficient algorithm that searches for a value in an m x n matrix, return the occurrence of it. This matrix has the following properties: Inte 阅读全文
posted @ 2016-04-05 16:51 哥布林工程师 阅读(130) 评论(0) 推荐(0) 编辑
摘要: Given two values k1 and k2 (where k1 < k2) and a root pointer to a Binary Search Tree. Find all the keys of tree in range k1 to k2. i.e. print all x s 阅读全文
posted @ 2016-04-05 12:48 哥布林工程师 阅读(125) 评论(0) 推荐(0) 编辑
摘要: Given a directed graph, design an algorithm to find out whether there is a route between two nodes. Example Given graph: A >B >C \ | \ | \ | \ v ->D > 阅读全文
posted @ 2016-04-05 12:40 哥布林工程师 阅读(180) 评论(0) 推荐(0) 编辑
摘要: Given a list, rotate the list to the right by k places, where k is non-negative. Example Given 1->2->3->4->5 and k = 2, return 4->5->1->2->3. /** * De 阅读全文
posted @ 2016-04-05 12:24 哥布林工程师 阅读(103) 评论(0) 推荐(0) 编辑
摘要: You are given an n x n 2D matrix representing an image.Rotate the image by 90 degrees (clockwise). Example Given a matrix [ [1,2], [3,4] ] rotate it b 阅读全文
posted @ 2016-04-05 11:52 哥布林工程师 阅读(130) 评论(0) 推荐(0) 编辑
摘要: Given a roman numeral, convert it to an integer. The answer is guaranteed to be within the range from 1 to 3999. Example IV -> 4 XII -> 12 XXI -> 21 X 阅读全文
posted @ 2016-04-05 11:12 哥布林工程师 阅读(110) 评论(0) 推荐(0) 编辑
上一页 1 2 3 4 5 6 7 8 ··· 23 下一页