摘要:
Remove all elements from a linked list of integers that have value val. ExampleGiven: 1 --> 2 --> 6 --> 3 --> 4 --> 5 --> 6, val = 6Return: 1 --> 2 -- 阅读全文
摘要:
Given a linked list, determine if it has a cycle in it. Follow up:Can you solve it without using extra space? 题目要求判断链表是否有环形,题目不难,方法很巧,典型的双指针问题,一开始现实判断 阅读全文
摘要:
A linked list is given such that each node contains an additional random pointer which could point to any node in the list or null. Return a deep copy 阅读全文
摘要:
Given a list, rotate the list to the right by k places, where k is non-negative. Example: Given 1->2->3->4->5->NULL and k = 2, return 4->5->1->2->3->N 阅读全文
摘要:
Given a linked list, reverse the nodes of a linked list k at a time and return its modified list. k is a positive integer and is less than or equal to 阅读全文
摘要:
Given a non-negative integer represented as a non-empty array of digits, plus one to the integer. You may assume the integer do not contain any leadin 阅读全文
摘要:
Implement int sqrt(int x). Compute and return the square root of x. x is guaranteed to be a non-negative integer. Example 1: Example 2: 时间复杂度:O(logn) 阅读全文
摘要:
首先要谈的是,今天的话题所聊的程序员包含哪些人? 在中国,写程序,不仅仅是一种兴趣,更多的时候,还是一种普通职业和谋生工具 大公司有厉害的程序员,优秀的架构师,但大量的小公司也有很多普通的程序员。在我这些年的工作经历中,也越来越深刻的感受到普通程序员的影响和力量。对于高阶程序员,所谓八仙过海各有神通 阅读全文
摘要:
Given a linked list, swap every two adjacent nodes and return its head. For example,Given 1->2->3->4, you should return the list as 2->1->4->3. Your a 阅读全文
摘要:
内部实现机理 map: map内部实现了一个红黑树,该结构具有自动排序的功能,因此map内部的所有元素都是有序的,红黑树的每一个节点都代表着map的一个元素,因此,对于map进行的查找,删除,添加等一系列的操作都相当于是对红黑树进行这样的操作,故红黑树的效率决定了map的效率。 unordered_ 阅读全文