自定义博客皮肤VIP专享

*博客头图:

格式为PNG、JPG,宽度*高度大于1920*100像素,不超过2MB,主视觉建议放在右侧,请参照线上博客头图

请上传大于1920*100像素的图片!

博客底图:

图片格式为PNG、JPG,不超过1MB,可上下左右平铺至整个背景

栏目图:

图片格式为PNG、JPG,图片宽度*高度为300*38像素,不超过0.5MB

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

-+
  • 博客(62)
  • 收藏
  • 关注

转载 使用 CreateInstallMedia 创建 苹果系统安装U盘

一般来说,从app store上面 下载下来的image位置,都是在 /Applications 下面使用命令创建安装U盘,(备份一下命令,太长,记不住)sudo /Applications/Install\ OS\ X\ Yosemite.app/Contents/Resources/createinstallmedia --volume /Volumes/USB -...

2014-12-12 15:56:00 1172

转载 一些不错的英文歌曲MV,留个存档!

Lambada [[http://www.yinyuetai.com/video/265213]]Trouble Is A Friend [[http://www.yinyuetai.com/video/524509]]Silver Lining [[http://www.yinyuetai.com/video/208871]]Good Is Good [[http://www.yiny...

2013-10-28 16:09:00 122

转载 [转] 史上最全英文免费编程电子书列表

史上最全英文免费编程电子书列表瑞士程序员Victor Felder在GitHub上放了一个免费电子书列表,是目前比较全的汇总,注意,其中的电子书都是作者或者出版社等版权所有人授权公开的,不是中文互联网到处都是的侵权电子版。这是StackOverflow上的列表基础上更新补充而成。放到GitHub上之后,人人都可以补充、修改,这很有可能成为史上最全列表。当然,如果能对各领域图...

2013-10-12 17:21:00 163

转载 Write a program to convert decimal to 32-bit unsigned binary.

Write a program to convert decimal to 32-bit unsigned binary.Write a program to convert a 32-bit unsigned binary to decimal两个成对的问题!转载于:https://www.cnblogs.com/yayagamer/p/3311239.html...

2013-09-09 22:48:00 106

转载 Top 5 Free Screen Recording Softwares For Windows

【转】Top 5 Free Screen Recording Softwares For Windows该文章是转过来的,因为这里介绍了好几款免费的录制视频的软件。我自己需要使用,也许大家也有需求。1. EzvidEzvid is a screen recorder program that comes with an in-built video editor ...

2013-08-30 15:46:00 158

转载 Given life time of different animals. Find period when maximum number of animals lived

Q:Given life time of different animals. Find period when maximum number of animals lived. ex [5, 11], [6, 18], [2, 5],[3,12] etc. year in which max no animals exists.A:Input intervals ...

2013-06-09 17:10:00 118

转载 there are atleast N pairs of x and y satisfying x^3 + y^3 = A

Q: function takes input x , y , A and Nreturns true ifthere are atleast N pairs of x and y satisfyingx^3 + y^3 = A;all inputs are postive integer valuesA: Taxicab numberhttp://en.wikip...

2013-04-24 17:21:00 98

转载 Convert one string S1 to another string S2 using only 3 types of operations

Q: Suppose we want to convert one string S1 to another string S2 using only 3 types of operations:-Insert(pos,char) (costs 8)-Delete(pos) (costs 6)-Replace(pos,char) (costs 8)Find the seque...

2013-04-24 17:18:00 64

转载 from given array of n elements find the maximum element for each consecutive sub-array of k elements...

Q: from given array of n elements find the maximum element for each consecutive sub-array of k elements.eg.array=[6,5,4,3,2,1]k=3ans=6 5 4 3explanation:6 from array [6,5,4]5 from array [5,4...

2013-03-20 09:50:00 91

转载 使用 VS 2012 编译 GTest 遇到的编译错误

下载好gtest-1.6.0,然后解压到一个目录下,比如e:\gtest-1.6.0如果大家尝试着用VS2012 去编译GTest (e:\gtest-1.6.0\msvc\gtest.sln),可能会碰到下面的编译错误:\gtest\include\gtest\gtest-printers.h(550): error C2977: 'std::tuple' : too many...

2013-03-10 10:58:00 217

转载 Google 面试准备清单

看到一个,程序员面试清单,转过来,以后用得着1. Integer – find number of 1s – next largest smaller – smallest larger number – determine if is palindrom – itoa, atoi – add 2 numbers w/...

2013-02-22 15:52:00 260

转载 Have an array we have to find longest subarray with consecutive numbers

Have an arraywe have to find longest subarray with consecutive numbersex [4,5,34,33,32,11,10,31]answer is[31,32,33,34][92 26 30 28 27]answer is [27, 28]NOT [26, 2...

2013-01-25 16:37:00 67

转载 回到昨天,你能够从股市赚到最多的钱么?

Q:假设你可以回到昨天,并且得到股市昨天的全天每个时刻的数据,你能够通过买卖交易,赚取最多的钱么?比如:1. {10, 20, 15, 18, 22, 20, 4, 5}{买入 卖出} {10, 20} {15, 22} {4, 5} 一共三次交易,赚了 10 + 7 + 1 = 18块钱2. {5, 10, 9, 10, 11, 11, 12, 100}...

2013-01-25 15:08:00 49

转载 [转] A sample of Multiply-with-carry, a pseudo-random number generator

The following is an implementation of the CMWC algorithm in theC programming language. Also, included in the program is a sample initialization function. In this implementation the lagr=4096...

2013-01-25 10:30:00 176

转载 Given an integer, return all sequences of numbers that sum to it

Q:Given an integer, return all sequences of numbers that sum to it. (Example: 3 -> (1, 2), (2, 1), (1, 1, 1)).A:class CalcSequenceNumber{private: static void print(int va...

2013-01-23 16:24:00 76

转载 What will be the change in complexity if we will choose 2 and 3 pivots in the quicksort algorithm

Q:What will be the change in complexity if we will choose 2 and 3 pivots in the quicksort algorithm ?The exact complexity and why ??A:if we use 2 element as a pivot (suppose 1st and last...

2012-06-25 10:55:00 79

转载 Two sorted array. Find kth smallest element, 要求O(logK)

Two sorted array. Find kth smallest elementO(logK)A:Compare A[k/2] and B[k/2].If A[k/2] < B[k/2], it means these A[1] to A[k/2] elements are part of first k elements.Now, the kth elemen...

2012-06-25 10:46:00 156

转载 Given an array of positive and negative integers find the first subarray with zero sum

Q:Given an array of positive and negative integers find the first subarray with zero sum?no 0's will be a part of the input array and handle all the edge casesA:1. iterate through the ...

2012-06-24 19:23:00 409

转载 顺时针打印数组,美丽版

今天看到一段代码,顺时针打印数组。写得太美了,简洁明了,几乎不用任何注释。转过来,原来是java版的,我改成了C++版。 1 void PrintMatrixClockWise() 2 { 3 int m = 5; 4 int n = 4; 5 int val[4][5] = 6 ...

2012-06-24 19:00:00 82

转载 Given a string S, find the longest palindromic substring in S.

题义很明细:求一个字符串S中的最长回文! 基本想法: for-loop i从0 – (n-1)遍历该字符串,从S[i] 或者 S[i+1]开始,向字符串S的两侧展开,判断是不是回文。如果是,再和当前的最长回文比较,如果更长,则替换当前最长的回文。 代码如下: // 从c1, c2开始 向两侧展开,找到最长的palindrome // e.g. 如果已经知道 "a...

2012-06-09 10:09:00 144

转载 上20阶楼梯,可以一次迈1,2,3步,请问有多少种上法?

很老的题目了,但是看到一种方法,非递归,贪心算法,遍历所有的可能的组合,并打印所有的步骤。void Calc_floors(){ int n=1; for (int X=0; X <=20; X++) { for (int Y=0; Y <=10; Y++) ...

2012-05-24 17:34:00 505

转载 Find out all the elements in A and B such that the A[i]-B[j]=C[k]

You have been given three arrays A,B and C.You have to find out all the elements in A and B such that the A[i]-B[j]=C[k]A:1. Put all the elements of array C in a HashTable - O(n) time and ...

2012-05-21 22:49:00 79

转载 一排房子,连续填色,成本最低的问题

Q:There are a row of houses, each house can be painted with three colors red, blue and green. The cost of painting each house with a certain color is different. You have to paint all the houses...

2012-03-22 23:03:00 52

转载 Count smaller elements on right side in an array.

Count smaller elements on right side in an array.eg : [4,12,5,6,1,34,3,2]o/p: [3,5,3,3,0,2,1,0]A1: 设原数组为a[i],output 的数组为b[i]1. 从右开始向左扫描2. 假设已经扫描到i,则遍历从a[i+1] 开始,到结束的所有数,找到j,使得 a[i] &gt...

2012-03-04 22:34:00 57

转载 C++ 类初始化的顺序

First, and only for the constructor of the most derived class as described below, virtual base classes shall be initialized in the order they appear on a depth-first left-to-right traversa...

2012-01-12 17:56:00 129

转载 C++'s mutable and conceptual constness

c++ 中的 mutable 关键字是什么意思?mutable is for the case where an object islogicallyconstant, but in practice needs to change.class Employee {public: Employee(const std::string & name) ...

2012-01-12 17:03:00 94

转载 Given constant integers x and t, write a function that takes no argument and returns true if the fun...

Given constant integers x and t, write a function that takes no argument and returns true if the function has been called x number of times in last t secs.Q: 题意很明确,实现一个函数,如果该函数在过去的t秒内,被call了x次,...

2012-01-12 11:37:00 109

转载 很多机器,每台机器上都有很一部分数据,如何输出分布在所有机器上的所有数据的median...

转化一下,There are two sorted arrays A and B of sizemandnrespectively. Find the median of the two sorted arrays. The overall run time complexity should beO(log (m+n)).有两个数组,如何求两个数组的中间值?找到一...

2012-01-09 16:11:00 128

转载 在一个二维有序数组中,查找指定的数据是否存在

Say Given a 2d array where all the numbers in the array are in increasing order from left to right and top to bottom.What is the best way to search and determine if a target number is in the ar...

2012-01-06 12:02:00 110

转载 Sum the linked lists

Sum the linked lists 1->2->3 4->5result is 1->6->81->5->95->3result 2->1->2A: 把链表的值加起来,注意,根据sample,是从链表的最后一位开始相加,而且,要考虑进位的问题pseudo code如下 (通过编译,但没...

2012-01-06 11:12:00 51

转载 There is integer array like {1,2,4,5,6,1,2,4,3,5,7,2,1}. I want to find the possible combination of ...

There is integer array like {1,2,4,5,6,1,2,4,3,5,7,2,1}. I want to find the possible combination of pair which sum is 4. input : {1,2,4,5,6,1,2,4,3,5,7,2,1}output : {1,1,2}, {2,2}, {3,1}, {1,2,1}...

2012-01-06 10:11:00 58

转载 填写下面的空白处

Fill in the blanks:_ _ _ H I K L M N T_ _ _ G J O P Q R SA:第一行所有的字母都是直线组成的第二行所有的字母都包括有曲线所以第一行前面补 A E F第二行前面补 B C D转载于:https://www.cnblogs.com/yayagamer/archive/2012/01/06/2313952...

2012-01-06 09:44:00 162

转载 [转] 如何成为“10倍效率”开发者

导读:Brad Feld的一篇文章The Rise of Developeronomics中提到了“10倍效率的开发者(10x developer)”的概念(伟大的开发者的效率往往比一般的开发者高很多,而不只是一点点),Adam Loving在读了之后受到启发,并向多位大牛(Ben Sharpe、Collin Watson和Jonathan Locke)询问如何成为“10倍效率的开发者”...

2011-12-30 14:05:00 71

转载 Print the numbers of form (2^i)*(5^j) in increasing order

Print the numbers of form (2^i)*(5^j) in increasing order, e.g. 1, 2, 4, 5, 8, 10, 16, 20, …Q:题目很简单了,就是打印整数序列,该序列的生成规则为(2^i)*(5^j)View Code 1 void Compute_Increasing_Order() 2 { 3 ...

2011-12-29 11:52:00 95

转载 Given an in-order traversal only for a binary tree (not necessarily a BST), …

Given an in-order traversal only for a binary tree (not necessarily a BST), give a pseudo code to generate all possible binary trees for this traversal sequence.A: 数学归纳法Firstly of all, wit...

2011-12-28 10:23:00 94

转载 Given a set of n symbols a size k and a combination of length k of non repeating characters from the...

Given a set of n symbols a size k and a combination of length k of non repeating characters from the symbol set. Write only an ITERATIVE algorithm to print the next unique combination.Ex: Symbo...

2011-12-23 17:11:00 85

转载 [转]追随自己的心——设立职业生涯目标的14步练习法

不知道自己的未来在何方?这着实是一件令人苦恼的事情。在第一职场网进行职业生涯规划的实际咨询过程中,有很多朋友不知道如何确立自己的目标,纷纷前来求助寻找目标的方法。大家不妨按照以下的14个步骤,反复实践,相信会对你的目标寻找有所帮助。 这是一个重要的练习,它能让你勇敢地去梦想,去了解自己。当我们不知我们要什么时,我们如何去要?所以,这个职业生涯规划的练习,是让我们去了解自己所要的,以及要如...

2011-12-20 09:47:00 205

转载 Given an expression remove the unnecessary brackets in it

Given an expression remove the unnecessary brackets in it without creating an ambiguity in its execution.input outputex1: (a+(b)+c) => a+b+cex2: (a*b)+c => a*b+c转载于:https://www.c...

2011-12-19 22:28:00 92

转载 Given an array of size n, find all the possible sub set of the array of size k

Given an array of size n, find all the possible sub set of the array of size k(all the subsets must be of size k).Q:给一个大小为n的数组,输出其中k个数字的组合。A:void subarray(int arr[], int t[], int n, int...

2011-12-19 14:16:00 144

转载 安排会议,使得每个员工能够参加至少两次会议,并使会议总次数最少

You are given N ranges of date offsets when N employees are present in an organization. Something like1-4 (i.e. employee will come on 1st, 2nd, 3rd and 4th day )2-68-9..1-14You have to orga...

2011-12-15 11:48:00 59

空空如也

空空如也

TA创建的收藏夹 TA关注的收藏夹

TA关注的人

提示
确定要删除当前文章?
取消 删除