08 2017 档案
摘要:作业链接 1、回想一下你初入大学时对计算机专业的畅想 当初你是如何做出选择计算机专业的决定的? 你认为过去两年中接触到的课程是否符合你对计算机专业的期待,为什么? 你觉得计算机是你喜欢的领域吗,它是你擅长的领域吗? 当初为什么选择计算机专业,其实就连我自己也不清不楚,至于为什么说不清不楚,倒不是说这
阅读全文
摘要:传送门 Description Given two words word1 and word2, find the minimum number of steps required to convert word1 to word2. (each operation is counted as 1
阅读全文
摘要:传送门 Description Given an integer (signed 32 bits), write a function to check whether it is a power of 4. Example:Given num = 16, return true. Given nu
阅读全文
摘要:传送门 Description The Hamming distance between two integers is the number of positions at which the corresponding bits are different. Now your job is to
阅读全文
摘要:传送门 Description Given a non-empty array of numbers, a0, a1, a2, … , an-1, where 0 ≤ ai < 231. Find the maximum result of ai XOR aj, where 0 ≤ i, j < n
阅读全文
摘要:传送门 Description Given an array of numbers nums, in which exactly two elements appear only once and all the other elements appear exactly twice. Find t
阅读全文
摘要:传送门 Description Given an array of integers, every element appears three times except for one, which appears exactly once. Find that single one. Note:Y
阅读全文
摘要:将代码包含在一个块中,eg. try catch 查看API
阅读全文
摘要:传送门 Description The Hamming distance between two integers is the number of positions at which the corresponding bits are different. Given two integers
阅读全文
摘要:传送门 Description Given an array of integers, every element appears twice except for one. Find that single one. Note:Your algorithm should have a linear
阅读全文
摘要:传送门 Description Given a string, find the length of the longest substring without repeating characters. Examples: Given “abcabcbb", the answer is "abc"
阅读全文
摘要:传送门 Description Given an unsorted array of integers, find the length of the longest consecutive elements sequence. For example,Given [100, 4, 200, 1,
阅读全文
摘要:传送门 Description Determine whether an integer is a palindrome. Do this without extra space. 思路 题意:判断输入的整数是否是一个回文数,要求不允许使用额外的空间 题解:可以肯定的是小于0以及尾数为0的整数不是回
阅读全文
摘要:传送门 Description Given an array nums containing n + 1 integers where each integer is between 1 and n (inclusive), prove that at least one duplicate num
阅读全文
摘要:Floyd判圈算法(Floyd Cycle Detection Algorithm),又称龟兔赛跑算法(Tortoise and Hare Algorithm),是一个可以在有限状态机、迭代函数或者链表上判断是否存在环,求出该环的起点与长度的算法。该算法据高德纳称由美国科学家罗伯特·弗洛伊德发明,但
阅读全文
摘要:传送门 Can you answer these queries? Time Limit: 4000/2000 MS (Java/Others) Memory Limit: 65768/65768 K (Java/Others)Total Submission(s): 18290 Accepted
阅读全文
摘要:传送门 Description There are two sorted arrays nums1 and nums2 of size m and n respectively. Find the median of the two sorted arrays. The overall run ti
阅读全文
摘要:传送门 Description Each New Year Timofey and his friends cut down a tree of n vertices and bring it home. After that they paint all the n its vertices, s
阅读全文
摘要:传送门 Description One day Polycarp published a funny picture in a social network making a poll about the color of his handle. Many of his friends starte
阅读全文
摘要:传送门 Description Binary trees can sometimes be very difficult to work with. Fortunately, there is a class of trees with some really nice properties. A
阅读全文
摘要:原链接:传送门 摘要 HashMap是Java程序员使用频率最高的用于映射(键值对)处理的数据类型。随着JDK(Java Developmet Kit)版本的更新,JDK1.8对HashMap底层的实现进行了优化,例如引入红黑树的数据结构和扩容的优化等。本文结合JDK1.7和JDK1.8的区别,深入
阅读全文
摘要:原链接:传送门 今天看到 boost::unordered_map,它与 stl::map的区别就是,stl::map是按照operator<比较判断元素是否相同,以及比较元素的大小,然后选择合适的位置插入到树中。所以,如果对map进行遍历(中序遍历)的话,输出的结果是有序的。顺序就是按照opera
阅读全文
摘要:传送门 Description A company has n employees numbered from 1 to n. Each employee either has no immediate manager or exactly one immediate manager, who is
阅读全文
摘要:传送门 Description Quite recently a creative student Lesha had a lecture on trees. After the lecture Lesha was inspired and came up with the tree of his
阅读全文