- 博客(46)
- 资源 (40)
- 收藏
- 关注
原创 LeetCode:Excel Sheet Column Title
Excel Sheet Column TitleMy SubmissionsQuestionTotal Accepted: 44218 Total Submissions: 224721 Difficulty: EasyGiven a positive integer, return its corresponding column title as
2015-11-27 15:07:44 460
原创 LeetCode:Rotate Array
Rotate ArrayTotal Accepted: 51189 Total Submissions: 264292 Difficulty: EasyRotate an array of n elements to the right by k steps.For example, with n = 7 and k = 3, the array [1,2,
2015-11-27 14:44:55 510
原创 LeetCode:Linked List Cycle
Linked List CycleTotal Accepted: 83564 Total Submissions: 228287 Difficulty: MediumGiven a linked list, determine if it has a cycle in it.Follow up:Can you solve it without using
2015-11-26 23:06:14 636
原创 LeetCode:Palindrome Linked List
Palindrome Linked ListTotal Accepted: 28267 Total Submissions: 113712 Difficulty: EasyGiven a singly linked list, determine if it is a palindrome.Follow up:Could you do it in O(n
2015-11-26 22:24:32 515
原创 LeetCode:Add Binary
Add BinaryTotal Accepted: 64222 Total Submissions: 252110 Difficulty: EasyGiven two binary strings, return their sum (also a binary string).For example,a = "11"b = "1"Return
2015-11-24 17:27:19 406
原创 LeetCode:Count and Say
Count and SayMy SubmissionsQuestionTotal Accepted: 62217 Total Submissions: 233796 Difficulty: EasyThe count-and-say sequence is the sequence of integers beginning as follows:
2015-11-24 16:44:50 464
原创 LeetCode:Remove Nth Node From End of List
Remove Nth Node From End of ListTotal Accepted: 82072 Total Submissions: 296476 Difficulty: EasyGiven a linked list, remove the nth node from the end of list and return its head.Fo
2015-11-22 21:00:45 386
原创 LeetCode:Rectangle Area
Rectangle AreaTotal Accepted: 23524 Total Submissions: 84978 Difficulty: EasyFind the total area covered by two rectilinear rectangles in a 2D plane.Each rectangle is defined by it
2015-11-22 17:18:31 503
原创 LeetCode:Minimum Depth of Binary Tree
Minimum Depth of Binary TreeTotal Accepted: 81059 Total Submissions: 274649 Difficulty: EasyGiven a binary tree, find its minimum depth.The minimum depth is the number of nodes alo
2015-11-20 22:33:52 444
原创 LeetCode:Reverse Integer
Reverse IntegerTotal Accepted: 108334 Total Submissions: 462300 Difficulty: EasyReverse digits of an integer.Example1: x = 123, return 321Example2: x = -123, return -321click t
2015-11-20 18:01:57 605
原创 LeetCode:Path Sum
Path SumTotal Accepted: 78908 Total Submissions: 261199 Difficulty: EasyGiven a binary tree and a sum, determine if the tree has a root-to-leaf path such that adding up all the value
2015-11-20 17:31:30 548
原创 LeetCode:Reverse Bits
Reverse BitsTotal Accepted: 43722 Total Submissions: 150010 Difficulty: EasyReverse bits of a given 32 bits unsigned integer.For example, given input 43261596 (represented in binar
2015-11-20 15:37:56 597
原创 LeetCode:Factorial Trailing Zeroes
Factorial Trailing ZeroesTotal Accepted: 42370 Total Submissions: 139281 Difficulty: EasyGiven an integer n, return the number of trailing zeroes in n!.Note: Your solution should b
2015-11-19 22:08:20 488
原创 队列实现栈
两个队列实现一个栈code:#include #include using namespace std;templateclass Stack{public: bool empty() { return q1.empty() && q2.empty(); } void put(const T &e) { q1.p
2015-11-18 23:01:45 455
原创 两个栈实现一个队列
两个栈实现一个队列#include #include using namespace std;templateclass Queue{public: bool empty() { return s1.empty() && s2.empty(); } void put(const T &e) { s2.push(e);
2015-11-18 22:20:21 579
原创 LeetCode:Binary Tree Level Order Traversal II
Binary Tree Level Order Traversal IITotal Accepted: 60177 Total Submissions: 188407 Difficulty: EasyGiven a binary tree, return the bottom-up level order traversal of its nodes' valu
2015-11-18 14:37:43 477
原创 LeetCode:Plus One
Plus OneTotal Accepted: 73167 Total Submissions: 233149 Difficulty: EasyGiven a non-negative number represented as an array of digits, plus one to the number.The digits are stored
2015-11-18 13:46:58 542
原创 a+b(高精度)
题目1198:a+b时间限制:1 秒内存限制:32 兆题目描述:实现一个加法器,使其能够输出a+b的值。输入:输入包括两个数a和b,其中a和b的位数不超过1000位。输出:可能有多组测试数据,对于每组数据,输出a+b的值。样例输入:2 610000000000000000000 100
2015-11-17 10:59:50 1295
原创 A sequence of numbers
题目1442:A sequence of numbers时间限制:1 秒内存限制:128 兆特殊判题:否提交:2298解决:541题目描述:Xinlv wrote some sequences on the paper a long time ago, they might be arithmetic or geometric
2015-11-16 17:51:17 657
原创 A ^ B
题目1441:人见人爱 A ^ B时间限制:1 秒内存限制:128 兆题目描述:求A^B的最后三位数表示的整数。说明:A^B的含义是“A的B次方”输入:输入数据包含多个测试实例,每个实例占一行,由两个正整数A和B组成(1输出:对于每个测试实例,请输出A^B的最后三位表示的整数,每个输出占一行。样例输
2015-11-16 16:53:53 515
原创 LeetCode:House Robber
House RobberTotal Accepted:41584Total Submissions:132317Difficulty:EasyYou are a professional robber planning to rob houses along a street. Each house has a certain amount of mo
2015-11-16 13:41:33 789
原创 LeetCode:Remove Element
Remove ElementTotal Accepted: 85866 Total Submissions: 266809 Difficulty: EasyGiven an array and a value, remove all instances of that value in place and return the new length.The
2015-11-16 11:07:28 448
原创 LeetCode:Symmetric Tree
Symmetric TreeMy SubmissionsQuestionTotal Accepted: 80764 Total Submissions: 249396 Difficulty: EasyGiven a binary tree, check whether it is a mirror of itself (ie, symmetric a
2015-11-16 10:24:28 500
原创 LeetCode:Power of Two
Power of TwoMy SubmissionsQuestionTotal Accepted: 38815 Total Submissions: 118702 Difficulty: EasyGiven an integer, write a function to determine if it is a power of two.Cred
2015-11-15 22:13:31 504
原创 LeetCode:Happy Number
Happy NumberTotal Accepted: 41299 Total Submissions: 121770 Difficulty: EasyWrite an algorithm to determine if a number is "happy".A happy number is a number defined by the followi
2015-11-15 16:16:15 603
原创 LeetCode:Reverse Linked List
Reverse Linked ListTotal Accepted: 60024 Total Submissions: 168196 Difficulty: EasyReverse a singly linked list.click to show more hints.Hint:A linked list can be reversed eith
2015-11-15 14:01:04 410
原创 LeetCode:Roman to Integer
Roman to IntegerTotal Accepted: 60723 Total Submissions: 168485 Difficulty: EasyGiven a roman numeral, convert it to an integer.Input is guaranteed to be within the range from 1 to
2015-11-15 13:28:02 483
原创 LeetCode:Majority Element
Majority ElementTotal Accepted: 74545 Total Submissions: 197687 Difficulty: EasyGiven an array of size n, find the majority element. The majority element is the element that appears
2015-11-15 12:58:53 483
原创 LeetCode:Lowest Common Ancestor of a Binary Search Tree
Lowest Common Ancestor of a Binary Search TreeTotal Accepted: 37087 Total Submissions: 97884 Difficulty: EasyGiven a binary search tree (BST), find the lowest common ancestor (LCA) o
2015-11-15 11:53:25 530
原创 LeetCode:Product of Array Except Self
Product of Array Except SelfTotal Accepted: 23412 Total Submissions: 60721 Difficulty: Medium Given an array of n integers where n > 1, nums, return an array output such that output[i] is ...
2015-11-15 11:17:38 532
原创 递归:全排列
题目1120:全排列时间限制:1 秒内存限制:32 兆题目描述:给定一个由不同的小写字母组成的字符串,输出这个字符串的所有全排列。我们假设对于小写字母有'a' 输入:输入只有一行,是一个由不同的小写字母组成的字符串,已知字符串的长度在1到6之间。输出:输出这个字符串的所有排列方式,每行一个排列。要求
2015-11-13 13:47:00 746
原创 图的深度优先遍历(DFS)
深度优先遍历递归定义深度优先遍历(Depth-First Traversal)假设给定图G的初态是所有顶点均未曾访问过。visited[i]=false;在G中任选一顶点v为初始出发点(源点),则深度优先遍历可定义如下:首先访问出发点v,并将其标记为已访问过;然后依次从v出发搜索v的每个邻接点w。若w未曾访问过,则以w为新的出发点继续进行深度优先遍历,直至图
2015-11-09 14:46:48 746
原创 时间复杂度
时间复杂度的估计在1秒内的运行时限, 设计的算法复 杂度不能超过百万级别,即不能超过一千万。即若算法的时间复杂度是O(n^2),则该n(往往在题目中会给出数据范围)不应大于3000,否则将会达到我们所说的千万数量级复杂度,从而程序运行时间超出题目中给出的用时限定。举例来说,我们不能在1秒时限的题目当中对10000个整数进行冒泡排序,而必须使用快速排序等时间复杂度为O
2015-11-09 13:44:42 1766
原创 图的广度优先遍历(BFS)
广度优先遍历广度优先遍历是连通图的一种遍历策略。因为它的思想是从一个顶点V0开始,辐射状地优先遍历其周围较广的区域,故得名。基本思想1、从图中某个顶点V0出发,并访问此顶点;2、从V0出发,访问V0的各个未曾访问的邻接点W1,W2,…,Wk;然后,依次从W1,W2,…,Wk出发访问各自未被访问的邻接点;3、重复步骤
2015-11-09 12:58:06 1791
原创 堆排序
堆排序特点堆排序(HeapSort)是一树形选择排序。堆排序的特点是:在排序过程中,将R[l..n]看成是一棵完全二叉树的顺序存储结构,利用完全二叉树中双亲结点和孩子结点之间的内在关系(参见二叉树的顺序存储结构),在当前无序区中选择关键字最大(或最小)的记录。常用于在选出数组只最小(大)的前k个值。算法分析堆排序的时间,主要由建立初始堆和反复重建堆这两部分的时间开销构成,它们均是通过调用Heapi...
2015-11-07 14:29:16 713
原创 LeetCode:Single Number III
Single Number IIITotal Accepted: 14412 Total Submissions: 36361 Difficulty: MediumGiven an array of numbers nums, in which exactly two elements appear only once and all the other e
2015-11-06 20:22:56 675
原创 LeetCode:Single Number
Single NumberTotal Accepted: 98435 Total Submissions: 210216 Difficulty: MediumGiven an array of integers, every element appears twice except for one. Find that single one.Note:Y
2015-11-06 20:10:36 529
原创 THU2015 fall 1-2 Company
THU2015 fall 1-2 Company描述 公司有n个员工,编号1 ~ n。员工数量众多,需要你为他们编写一个管理系统。 员工上班时都要登录管理系统登记一个code,离开要从管理系统上注销,员工也可以随时更新自己的code。到了下班时间,所有员工都会自动注销。公司管理人员随时都可能想要知道有多少员工上班,以及任一员工登记的code。输入
2015-11-05 10:26:40 2349
原创 THU2015 fall 1-3 Interview
THU2015 fall 1-3 Interview描述 某公司在对应聘者做过一轮笔试之后,从中选出n 人继续进行面试,每位应聘者被分配了一个整数ID。 为公平起见,组织者决定利用会议室外的圆桌,按以下方法“随机”确定面试顺序:第一个到达的应聘者在圆桌周围任意选择一个位置坐下;此后到达的每位应聘者都从前一应聘者出发,沿逆时针方向围圆桌走过m 人(前一应聘者算作走
2015-11-05 10:24:18 1749
原创 THU2015 fall 1-1 Team
THU2015 fall 1-1 Team描述 教练员A、B和C将要从编号为1到n的队员中挑选自己的队员。为公平起见,每个教练都根据自己的喜好程度将队员排序;你负责根据以下规则为他们分配队员。 你拿到的数据是a、b、c三个数组,表示三个教练对队员的喜好程度排序,每个数组都是数字1到n的一个排列,下标越小表示教练越喜欢该队员。你的分组规则是,从还未被分配的队员中找
2015-11-05 10:20:39 1707
WebGL编程指南 [KouichiMatsuda著;RodgerLea著;谢光磊][电子工业出版社][2014.06][470页]
2015-12-28
《OpenGL ES 2.0 开发向导》源码
2018-12-28
Android 开发艺术探索高清完整版(电子版)
2018-08-22
FFmpeg4Android:视频文件推流
2018-03-30
程序员接单宝典_第3版_韦刃著
2016-01-05
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人