摘要:
题目描述:(链接)Given a sorted linked list, delete all nodes that have duplicate numbers, leaving onlydistinctnumbers from the original list.For example,Give... 阅读全文
摘要:
具体描述见《统计学习方法》第三章。 1 // 2 // main.cpp 3 // kNN 4 // 5 // Created by feng on 15/10/24. 6 // Copyright © 2015年 ttcn. All rights reserved. 7 //... 阅读全文
摘要:
题目描述:(链接)Design a stack that supports push, pop, top, and retrieving the minimum element in constant time.push(x) -- Push element x onto stack.pop() -... 阅读全文
摘要:
题目描述:(链接)Given a sorted linked list, delete all duplicates such that each element appear onlyonce.For example,Given1->1->2, return1->2.Given1->1->2->3... 阅读全文
摘要:
题目描述:(链接)Given a linked list and a valuex, partition it such that all nodes less thanxcome before nodes greater than or equal tox.You should preserve ... 阅读全文
摘要:
题目描述:(链接)Given an array of sizen, find the majority element. The majority element is the element that appears more than⌊ n/2 ⌋times.You may assume tha... 阅读全文
摘要:
题目描述:(链接)Given a binary tree, find its maximum depth.The maximum depth is the number of nodes along the longest path from the root node down to the fa... 阅读全文
摘要:
题目描述:(链接)Reverse a singly linked list.解题思路:链表真讨厌,总是出错。头插法。 1 /** 2 * Definition for singly-linked list. 3 * struct ListNode { 4 * int val; 5 *... 阅读全文
摘要:
题目描述:(链接)Reverse a linked list from positionmton. Do it in-place and in one-pass.For example:Given1->2->3->4->5->NULL,m= 2 andn= 4,return1->4->3->2->5... 阅读全文
摘要:
题目描述:(链接):Given an arraynums, write a function to move all0's to the end of it while maintaining the relative order of the non-zero elements.For examp... 阅读全文