10 2017 档案

摘要:Given an array of characters, compress it in-place. The length after compression must always be smaller than or equal to the original array. Every ele 阅读全文
posted @ 2017-10-31 17:22 immjc 阅读(287) 评论(0) 推荐(0)
摘要:How would you print just the 10th line of a file? For example, assume that file.txt has the following content: Your script should output the tenth lin 阅读全文
posted @ 2017-10-31 15:59 immjc 阅读(130) 评论(0) 推荐(0)
摘要:We have two special characters. The first character can be represented by one bit 0. The second character can be represented by two bits (10 or 11). N 阅读全文
posted @ 2017-10-31 15:46 immjc 阅读(494) 评论(0) 推荐(0)
摘要:HTTP 请求访问文本或图像等资源的一端称为客户端 提供资源响应的一端称为服务器端。 请求报文是由请求方法、请求URI、协议版本、可选的请求首部字段、内容实体 响应报文是由协议版本、状态码、原因短语、可选响应首部字段、实体 HTTP是一种无状态协议。 HTTP协议自身不具备保存之前发送过的请求或响应 阅读全文
posted @ 2017-10-31 15:18 immjc 阅读(173) 评论(0) 推荐(0)
摘要:Write a SQL query to get the second highest salary from the Employee table. For example, given the above Employee table, the query should return 200 a 阅读全文
posted @ 2017-10-24 11:52 immjc 阅读(146) 评论(0) 推荐(0)
摘要:Write a SQL query to delete all duplicate email entries in a table named Person, keeping only unique emails based on its smallest Id. For example, aft 阅读全文
posted @ 2017-10-24 11:46 immjc 阅读(149) 评论(0) 推荐(0)
摘要:There is a table courses with columns: student and class Please list out all classes which have more than or equal to 5 students. For example, the tab 阅读全文
posted @ 2017-10-24 11:34 immjc 阅读(495) 评论(0) 推荐(0)
摘要:Given a Weather table, write a SQL query to find all dates' Ids with higher temperature compared to its previous (yesterday's) dates. + + + + | Id(INT 阅读全文
posted @ 2017-10-24 11:20 immjc 阅读(147) 评论(0) 推荐(0)
摘要:Suppose that a website contains two tables, the Customers table and the Orders table. Write a SQL query to find all customers who never order anything 阅读全文
posted @ 2017-10-24 09:38 immjc 阅读(124) 评论(0) 推荐(0)
摘要:The Employee table holds all employees including their managers. Every employee has an Id, and there is also a column for the manager Id. Given the Em 阅读全文
posted @ 2017-10-23 22:17 immjc 阅读(207) 评论(0) 推荐(0)
摘要:Table: Person Table: Address Write a SQL query for a report that provides the following information for each person in the Person table, regardless if 阅读全文
posted @ 2017-10-23 21:03 immjc 阅读(122) 评论(0) 推荐(0)
摘要:Given a pattern and a string str, find if str follows the same pattern. Here follow means a full match, such that there is a bijection between a lette 阅读全文
posted @ 2017-10-17 17:15 immjc 阅读(122) 评论(0) 推荐(0)
摘要:Given a binary tree, find its minimum depth. The minimum depth is the number of nodes along the shortest path from the root node down to the nearest l 阅读全文
posted @ 2017-10-17 16:01 immjc 阅读(117) 评论(0) 推荐(0)
摘要:std::vector 向量是表示可以动态改变大小的数组的序列容器。就像数组一样,向量为它们的元素使用连续的存储位置,这意味着它们的元素也可以使用对其元素的常规指针的偏移进行访问,并且与数组中一样有效。但是与数组不同的是,它们的大小可以动态地改变,其存储由容器自动处理。在内部,向量使用动态分配的数组 阅读全文
posted @ 2017-10-17 13:34 immjc 阅读(4197) 评论(0) 推荐(0)
摘要:Give a string s, count the number of non-empty (contiguous) substrings that have the same number of 0's and 1's, and all the 0's and all the 1's in th 阅读全文
posted @ 2017-10-16 18:52 immjc 阅读(869) 评论(0) 推荐(0)
摘要:Given a non-empty array of non-negative integers nums, the degree of this array is defined as the maximum frequency of any one of its elements. Your t 阅读全文
posted @ 2017-10-16 17:43 immjc 阅读(782) 评论(0) 推荐(0)
摘要:Implement atoi to convert a string to an integer. Hint: Carefully consider all possible input cases. If you want a challenge, please do not see below 阅读全文
posted @ 2017-10-13 22:17 immjc 阅读(170) 评论(0) 推荐(0)
摘要:比较两个字符串A和B,确定A中是否包含B中所有的字符。字符串A和B中的字符都是 大写字母 注意事项 在 A 中出现的 B 字符串里的字符不需要连续或者有序。 样例 给出 A = "ABCD" B = "ACD",返回 true 给出 A = "ABCD" B = "AABC", 返回 false 思 阅读全文
posted @ 2017-10-13 20:08 immjc 阅读(209) 评论(0) 推荐(0)
摘要:Given a string containing just the characters '(', ')', '{', '}', '[' and ']', determine if the input string is valid. The brackets must close in the 阅读全文
posted @ 2017-10-13 11:25 immjc 阅读(113) 评论(0) 推荐(0)
摘要:We define the Perfect Number is a positive integer that is equal to the sum of all its positive divisors except itself. Now, given an integer n, write 阅读全文
posted @ 2017-10-13 10:44 immjc 阅读(117) 评论(0) 推荐(0)
摘要:Given a string s and a non-empty string p, find all the start indices of p's anagrams in s. Strings consists of lowercase English letters only and the 阅读全文
posted @ 2017-10-12 11:35 immjc 阅读(171) 评论(0) 推荐(0)
摘要:进程的概念 在多道程序环境下,允许多个程序并发执行,此时它们将失去封闭性,并具有间断性及不可再现性的特征。为此引入了进程(Process)的概念,以便更好地描述和控制程序的并发执行,实现操作系统的并发性和共享性。 为了使参与并发执行的程序(含数据)能独立地运行,必须为之配置一个专门的数据结构,称为进 阅读全文
posted @ 2017-10-11 10:31 immjc 阅读(230) 评论(0) 推荐(0)
摘要:1.操作系统的概念 计算机系统自下而上可粗分为四个部分:硬件、操作系统、应用程序和用户(这里的划分与计算机组成原理的分层不同)。操作系统管理各种计算机硬件,为应用程序提供基础,并充当计算机硬件与用户之间的中介。 操作系统(Operating System, OS)是指控制和管理整个计算机系统的硬件和 阅读全文
posted @ 2017-10-10 20:34 immjc 阅读(621) 评论(0) 推荐(0)
摘要:Given a non-empty 2D array grid of 0's and 1's, an island is a group of 1's (representing land) connected 4-directionally (horizontal or vertical.) Yo 阅读全文
posted @ 2017-10-10 13:55 immjc 阅读(631) 评论(0) 推荐(0)
摘要:源和目的端口号:与IP头部中源和目的IP地址一起,唯一的表示了每个连接。序列号:标识了TCP发送端到TCP接收端的数据流的一个字节,该字节代表着包含该序列号的报文段的数据中的第一个字节。32位无符号0~(2^32 - 1)循环。确认号:该确认号的发送方期待接受的下一个序列号。只有在ACK位字段启用下 阅读全文
posted @ 2017-10-10 13:27 immjc 阅读(407) 评论(0) 推荐(0)
摘要:Given a 2d grid map of '1's (land) and '0's (water), count the number of islands. An island is surrounded by water and is formed by connecting adjacen 阅读全文
posted @ 2017-10-10 13:23 immjc 阅读(180) 评论(0) 推荐(0)
摘要:Given a positive integer, check whether it has alternating bits: namely, if two adjacent bits will always have different values. Example 1: Example 2: 阅读全文
posted @ 2017-10-09 21:41 immjc 阅读(157) 评论(0) 推荐(0)
摘要:IP是TCP/IP协议族中的核心协议。 IP提供一种尽力而为、无连接的数据报交付服务。 “尽力而为”的含义是不保证IP数据报能成功到达目的地。虽然IP不是简单丢弃所有不必要流量,但它也不对自己尝试交付的数据报提供保障。当某些错误发生时,IP提供一个简单的错误处理方法:丢弃一些数据(通常是最后达到的数 阅读全文
posted @ 2017-10-08 16:34 immjc 阅读(701) 评论(0) 推荐(0)
摘要:Given two strings s and t, determine if they are isomorphic. Two strings are isomorphic if the characters in s can be replaced to get t. All occurrenc 阅读全文
posted @ 2017-10-07 16:55 immjc 阅读(184) 评论(0) 推荐(0)
摘要:Given a binary tree and a sum, determine if the tree has a root-to-leaf path such that adding up all the values along the path equals the given sum. F 阅读全文
posted @ 2017-10-07 16:07 immjc 阅读(140) 评论(0) 推荐(0)
摘要:The count-and-say sequence is the sequence of integers with the first five terms as following: 1 is read off as "one 1" or 11.11 is read off as "two 1 阅读全文
posted @ 2017-10-07 12:07 immjc 阅读(138) 评论(0) 推荐(0)
摘要: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 阅读(158) 评论(0) 推荐(0)
摘要:TCP的建立与终止 三次握手与四次挥手 TCP提供一种可靠、面向连接、字节流、传输层的服务。TCP是一种面向连接的单播协议。 一个TCP连接由一个4元组构成,它们分别是源IP地址和源端口号,目的IP地址和目的端口号。更准确的说,一个TCP连接是由一对端点或套接字构成,其中通信的每一端都由一对(IP地 阅读全文
posted @ 2017-10-03 19:06 immjc 阅读(347) 评论(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 阅读(112) 评论(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 阅读(171) 评论(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 阅读(158) 评论(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 阅读(90) 评论(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 阅读(115) 评论(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 阅读(139) 评论(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 阅读(112) 评论(0) 推荐(0)