上一页 1 ··· 18 19 20 21 22 23 24 25 26 ··· 37 下一页
摘要: Given a linked list, determine if it has a cycle in it. Follow up:Can you solve it without using extra space? 带环链表的检测,使用快慢指针判断,快指针每次走两步,慢指针每次走一步,如果快慢指 阅读全文
posted @ 2017-10-07 11:42 immjc 阅读(149) 评论(0) 推荐(0) 编辑
摘要: TCP的建立与终止 三次握手与四次挥手 TCP提供一种可靠、面向连接、字节流、传输层的服务。TCP是一种面向连接的单播协议。 一个TCP连接由一个4元组构成,它们分别是源IP地址和源端口号,目的IP地址和目的端口号。更准确的说,一个TCP连接是由一对端点或套接字构成,其中通信的每一端都由一对(IP地 阅读全文
posted @ 2017-10-03 19:06 immjc 阅读(321) 评论(0) 推荐(1) 编辑
摘要: Given a sorted array, remove the duplicates in place such that each element appear only once and return the new length. Do not allocate extra space fo 阅读全文
posted @ 2017-10-02 22:53 immjc 阅读(101) 评论(0) 推荐(0) 编辑
摘要: Determine whether an integer is a palindrome. Do this without extra space. Some hints: Could negative integers be palindromes? (ie, -1) If you are thi 阅读全文
posted @ 2017-10-02 22:16 immjc 阅读(156) 评论(0) 推荐(0) 编辑
摘要: We are playing the Guess Game. The game is as follows: I pick a number from 1 to n. You have to guess which number I picked. Every time you guess wron 阅读全文
posted @ 2017-10-02 12:04 immjc 阅读(149) 评论(0) 推荐(0) 编辑
摘要: Given an integer n, return the number of trailing zeroes in n!. Note: Your solution should be in logarithmic time complexity. 计算n!结果的末尾有几个零。 题目要求复杂度为对 阅读全文
posted @ 2017-10-02 11:33 immjc 阅读(84) 评论(0) 推荐(0) 编辑
摘要: Implement the following operations of a queue using stacks. push(x) -- Push element x to the back of queue. pop() -- Removes the element from in front 阅读全文
posted @ 2017-10-02 11:17 immjc 阅读(105) 评论(0) 推荐(0) 编辑
摘要: You have a total of n coins that you want to form in a staircase shape, where every k-th row must have exactly kcoins. Given n, find the total number 阅读全文
posted @ 2017-10-02 10:44 immjc 阅读(127) 评论(0) 推荐(0) 编辑
摘要: Count the number of segments in a string, where a segment is defined to be a contiguous sequence of non-space characters. Please note that the string 阅读全文
posted @ 2017-10-01 16:30 immjc 阅读(100) 评论(0) 推荐(0) 编辑
摘要: const限定符 因为const对象一旦创建后其值就不能再改变,因此const对象必须初始化。 如果利用一个对象初始化另外一个对象,则它们是不是const都无关紧要。 通过以上初始化操作可知:const的常量特征仅仅在执行改变其值的操作时才会发挥作用。 默认情况下,const对象被设定为仅在文件内有 阅读全文
posted @ 2017-09-30 12:46 immjc 阅读(310) 评论(0) 推荐(0) 编辑
上一页 1 ··· 18 19 20 21 22 23 24 25 26 ··· 37 下一页