上一页 1 ··· 15 16 17 18 19 20 21 22 23 ··· 35 下一页
摘要: Write an efficient algorithm that searches for a value in an m x n matrix. This matrix has the following properties:Integers in each row are s... 阅读全文
posted @ 2015-09-16 13:06 gqtc 阅读(90) 评论(0) 推荐(0)
摘要: Given an array with n objects colored red,white or blue, sort them so that objects of the same color are adjacent, with the colors in the orde... 阅读全文
posted @ 2015-09-15 13:04 gqtc 阅读(109) 评论(0) 推荐(0)
摘要: Given a m x n matrix, if an element is 0, set its entire row and column to 0. Do it in place. Follow up:Did you use extra space?A strai... 阅读全文
posted @ 2015-09-14 12:46 gqtc 阅读(213) 评论(0) 推荐(0)
摘要: 在Libev的源码中,用到了一种用C实现类似C++中继承的技巧,主要是用宏和结构体实现。 在Libev中,最关键的数据结构就是各种监视器,比如IO监视器,信号监视器等等。这些监视器的多数成员都是一样的,只有少部分成员为各自独有。这就非常类似于C++中继承的使用场景了... 阅读全文
posted @ 2015-09-13 17:11 gqtc 阅读(385) 评论(0) 推荐(0)
摘要: 一:查找1:strcspn函数 该函数是标准库的函数,包含在头文件中,其原型如下:size_t strcspn(const char *s1, const char *s2); 该函数计算字符串s1中,从头开始的某子串的长度,该子串中的字符都不会在s2中出现。举例如下... 阅读全文
posted @ 2015-09-12 21:57 gqtc 阅读(394) 评论(0) 推荐(0)
摘要: Implement int sqrt(int x). Compute and return the square root of x. 1:二分查找 思路:要实现一个sqrt函数,可以使用二分法,首先确定一个范围[begin, end],这个范围的中间数m... 阅读全文
posted @ 2015-09-12 10:53 gqtc 阅读(406) 评论(0) 推荐(0)
摘要: Given an array of words and a length L, format the text such that each line has exactly L characters and is fully(left and right) justified. ... 阅读全文
posted @ 2015-09-10 22:15 gqtc 阅读(137) 评论(0) 推荐(0)
摘要: Given a m x n grid filled with non-negative numbers, find a path from top left to bottom right which minimizes the sum of all numbers along it... 阅读全文
posted @ 2015-09-10 21:05 gqtc 阅读(195) 评论(0) 推荐(0)
摘要: 1.uptime命令 uptime gives a one line display of the following information. The current time, how long the system has been running, how many use... 阅读全文
posted @ 2015-09-09 11:00 gqtc 阅读(296) 评论(0) 推荐(0)
摘要: 有时通过SecureCRT或者Putty远程ssh到主机上执行某个进程,因长时间没有交互导致ssh断链,此时该进程由init进程收留。该进程的输出也就无法获得了。 这种情况下,可以利用gdb重新获得该进程的标准输出,方法如下: 1:获得程序的进程号(... 阅读全文
posted @ 2015-08-31 21:39 gqtc 阅读(714) 评论(0) 推荐(0)
上一页 1 ··· 15 16 17 18 19 20 21 22 23 ··· 35 下一页