上一页 1 ··· 3 4 5 6 7
摘要: 7 - Reverse digits of an integer.Example1:x = 123, return 321Example2:x = -123, return -321Notice:1.If the integer's last digit is 0, what should the ... 阅读全文
posted @ 2015-07-27 21:45 irun 阅读(159) 评论(0) 推荐(0) 编辑
摘要: 237 -Delete Node in a Linked ListWrite a function to delete a node (except the tail) in a singly linked list, given only access to that node.Supposed ... 阅读全文
posted @ 2015-07-26 23:03 irun 阅读(172) 评论(0) 推荐(0) 编辑
摘要: You are climbing a stair case. It takesnsteps to reach to the top.Each time you can either climb 1 or 2 steps. In how many distinct ways can you climb... 阅读全文
posted @ 2015-07-26 22:26 irun 阅读(123) 评论(0) 推荐(0) 编辑
摘要: 9 - Palindrome NumberDetermine whether an integer is a palindrome. Do this without extra space.Some hints:Could negative integers be palindromes? (ie,... 阅读全文
posted @ 2015-07-26 20:41 irun 阅读(158) 评论(0) 推荐(0) 编辑
摘要: 题目示例: "abcdefgh" 循环右移3位得到 "defghabc"解法一:消耗额外的3个空间,空间复杂度为O(n),当程序运行的空间比较苛刻的时候,不可取。时间复杂度为O(n)1 int main(){2 char source[]="abcdefg";3 char *temp... 阅读全文
posted @ 2015-05-24 20:54 irun 阅读(310) 评论(0) 推荐(0) 编辑
摘要: 一、笔试百度文库(趋势科技2015校园招聘笔试题)有很多原题,考的范围很广,计算机网络:协议,c++:继承、字节对齐、二维数组等等,总体一般,不深不浅。贴几道印象深的题:1.多态类中的虚函数表是Compile-Time,还是Run-Time时建立的?答案:虚拟函数表是在编译期就建立了,各个虚拟函数这... 阅读全文
posted @ 2015-05-19 18:05 irun 阅读(1775) 评论(0) 推荐(0) 编辑
摘要: 原题:Given a triangle, find the minimum path sum from top to bottom. Each step you may move to adjacent numbers on the row below.For example, given the ... 阅读全文
posted @ 2015-05-15 21:27 irun 阅读(283) 评论(0) 推荐(0) 编辑
摘要: 美国国家仪器NI也算是入驻上海很好的一家外企了,它是我们院的合作公司,加上今年NI在我们院扩招实习生,这次是一个难得的机会可以进入NI实习,可惜我并没有好好把握...一、笔试几个做错的印象特别深刻:ICMP是干什么的?用于传输出错报告控制信息。x&(x-1)-->判断x里有几个1,我居然紧张得数错1... 阅读全文
posted @ 2015-05-14 20:49 irun 阅读(500) 评论(0) 推荐(0) 编辑
摘要: 题目描述:在一个M * N的矩阵中,所有的元素只有0和1,从这个矩阵中找出一个面积最大的全1子矩阵,所谓最大是指元素1的个数最多。输入:输入可能包含多个测试样例。对于每个测试案例,输入的第一行是两个整数m、n(1 2 using namespace std; 3 4 int main() 5 { ... 阅读全文
posted @ 2015-05-10 22:39 irun 阅读(1063) 评论(0) 推荐(0) 编辑
摘要: 昨天参加了华为南研所校招的机试,一共三道题,第一题很简单,输入一个字符串格式的日期,年-月,输出该月有多少天,主要注意闰年((%4==0&&%100!=0)||%400==0)2月的不同;第二题是判断字符串的括号组成正确与否,用栈解决;第三题限定时间,没有做出来,今天问了同学,记录一下:/*输入n行... 阅读全文
posted @ 2015-05-10 21:06 irun 阅读(1072) 评论(0) 推荐(0) 编辑
上一页 1 ··· 3 4 5 6 7