上一页 1 ··· 6 7 8 9 10 11 12 13 14 ··· 33 下一页
摘要: Question: How do you shuffle an array in place?伪代码如下:To shuffle an array a of n elements (indices 0..n-1): for i from n − 1 downto 1 do j ← ran... 阅读全文
posted @ 2016-01-25 01:34 Hygeia 阅读(240) 评论(0) 推荐(0) 编辑
摘要: /*Suppose you have a long flowerbed in which some of the plots are planted and some are not. However, flowers cannot be planted in adjacent plots - th... 阅读全文
posted @ 2016-01-24 08:54 Hygeia 阅读(301) 评论(0) 推荐(0) 编辑
摘要: /*** Return the smallest character that is strictly larger than the search character,* If no such character exists, return the smallest character in t... 阅读全文
posted @ 2016-01-24 07:46 Hygeia 阅读(272) 评论(0) 推荐(0) 编辑
摘要: Given an array of positive integers. All numbers occur even number of times except one number which occurs odd number of times. Find the number in O(n... 阅读全文
posted @ 2016-01-24 05:44 Hygeia 阅读(276) 评论(0) 推荐(0) 编辑
摘要: This question was asked in the first coding round on-site.Give two sorted lists List a and List b.Findthe Union of these two lists -> the union list s... 阅读全文
posted @ 2016-01-24 05:30 Hygeia 阅读(283) 评论(0) 推荐(0) 编辑
摘要: There are 2 sorted sets.Find the common elements of those setse.g.A={1,2,3,4,5,6}B={5,6,7,8,9}o/p C={5,6}Complexity should ne 0(n+m) where n and m is ... 阅读全文
posted @ 2016-01-24 02:55 Hygeia 阅读(204) 评论(0) 推荐(0) 编辑
摘要: Fill in the following methods:public interface PointsOnAPlane { /** * Stores a given point in an internal data structure */ void addPoin... 阅读全文
posted @ 2016-01-24 02:39 Hygeia 阅读(246) 评论(0) 推荐(0) 编辑
摘要: public interface InfluencerFinder {/*** Given a matrix of following between N LinkedIn users (with ids from 0 to N-1):* followingMatrix[i][j] == true ... 阅读全文
posted @ 2016-01-24 01:27 Hygeia 阅读(326) 评论(0) 推荐(0) 编辑
摘要: Given a list of tuples representing intervals, return the range these intervalscovered.e.g:[(1,3), (2,5),(8,9)] should return 5和 merge interval非常类似pub... 阅读全文
posted @ 2016-01-24 01:13 Hygeia 阅读(220) 评论(0) 推荐(0) 编辑
摘要: Write a program that gives count of common characters presented in an array of strings..(or array of character arrays)For eg.. for the following input... 阅读全文
posted @ 2016-01-23 08:44 Hygeia 阅读(203) 评论(0) 推荐(0) 编辑
上一页 1 ··· 6 7 8 9 10 11 12 13 14 ··· 33 下一页