- 博客(34)
- 资源 (8)
- 收藏
- 关注
原创 [leetcode]41 Climbing Stairs
题目链接:https://leetcode.com/problems/climbing-stairs/ Runtimes:2ms1、问题You are climbing a stair case. It takes n steps to reach to the top.Each time you can either climb 1 or 2 steps. In how many distinc
2015-03-31 10:59:54 445
原创 [leetcode]40 Remove Nth Node From End of List
题目链接:https://leetcode.com/problems/remove-nth-node-from-end-of-list/ Runtimes:11ms1、问题Given a linked list, remove the nth node from the end of list and return its head.For example, Given linked list
2015-03-31 10:44:06 439
原创 [leetcode]39 Valid Parentheses
题目链接:https://leetcode.com/problems/valid-parentheses/ Runtimes:3ms1、问题Given a string containing just the characters ‘(‘, ‘)’, ‘{‘, ‘}’, ‘[’ and ‘]’, determine if the input string is valid.The brackets
2015-03-31 10:39:23 383
原创 [leetcode]38 Longest Common Prefix
题目链接:https://leetcode.com/problems/longest-common-prefix/ Runtimes:8ms1、问题Write a function to find the longest common prefix string amongst an array of strings.2、分析简单的题目,查找字符串集合中最长前缀。3、小结string函数中subs
2015-03-31 10:09:28 411
原创 [leetcode]37 Roman to Integer
题目链接:https://leetcode.com/problems/roman-to-integer/ Runtimes:57ms1、问题Given a roman numeral, convert it to an integer. Input is guaranteed to be within the range from 1 to 3999.2、分析简单的模式匹配过程,数字参考了这篇文
2015-03-31 09:41:33 392
原创 [leetcode]36 ZigZag Conversion
题目链接:https://leetcode.com/problems/zigzag-conversion/ Runtimes:40ms1、问题The string “PAYPALISHIRING” is written in a zigzag pattern on a given number of rows like this: (you may want to display this pat
2015-03-30 22:34:31 366
原创 [leetcode]35 Reverse Integer
文章链接:https://leetcode.com/problems/reverse-integer/ Runtimes:14ms1、问题Reverse digits of an integer. Example1: x = 123, return 321 Example2: x = -123, return -321 Have you thought about this? Here
2015-03-30 21:46:30 413
原创 [leetcode]34 String to Integer (atoi)
题目链接:https://leetcode.com/problems/string-to-integer-atoi/ Runtimes:15ms1、问题Implement atoi to convert a string to an integer. Hint: Carefully consider all possible input cases. If you want a challen
2015-03-30 21:32:00 432
原创 [leetcode]33 Palindrome Number
题目链接:https://leetcode.com/problems/palindrome-number/ Runtimes:131ms1、问题Determine whether an integer is a palindrome. Do this without extra space.2、分析删除回文,传统思路是按照顺序将数字存入数组,然后进行字符串回文检查。但是问题要求不要有额外空间,想了
2015-03-30 15:21:00 435
原创 [leetcode]32 Length of Last Word
题目链接:https://leetcode.com/problems/length-of-last-word/ Runtimes:4ms1、问题Given a string s consists of upper/lower-case alphabets and empty space characters ’ ‘, return the length of last word in the st
2015-03-28 16:18:50 390
原创 [leetcode]31 Symmetric Tree
题目链接:https://leetcode.com/problems/symmetric-tree/ Runtimes:8ms1、问题Given a binary tree, check whether it is a mirror of itself (ie, symmetric around its center).For example, this binary tree is symmet
2015-03-28 15:36:53 388
原创 [leetcode]30 Remove Duplicates from Sorted List
题目链接: Runtimes:1、问题Given a sorted linked list, delete all duplicates such that each element appear only once. For example, Given 1->1->2, return 1->2. Given 1->1->2->3->3, return 1->2->3. 2、分析
2015-03-28 15:13:35 415
原创 [leetcode]29 Merge Sorted Array
题目链接:https://leetcode.com/problems/merge-sorted-array/ Runtimes:7ms1、问题Given two sorted integer arrays A and B, merge B into A as one sorted array. Note: You may assume that A has enough space (s
2015-03-28 15:06:30 366
原创 [leetcode]28 Same Tree
题目链接:https://leetcode.com/problems/same-tree/ Runtimes:3ms1、问题Given two binary trees, write a function to check if they are equal or not.Two binary trees are considered equal if they are structurally
2015-03-28 11:52:25 386
原创 [leetcode]27 Reverse Bits
题目链接:https://leetcode.com/problems/reverse-bits/ Runtimes:10ms1、问题Reverse bits of a given 32 bits unsigned integer. For example, given input 43261596 (represented in binary as 0000001010010100
2015-03-28 10:20:04 524
原创 2014 华为模拟考题目
1、首尾字符不变,中间字符降序排列(字符串长度为7) input :CEAedca output:CedcEAa 时间空间都没要求。 void solution1() { char str[8]; cin >> str; for (int i = 1; i < 6; i++) { bool isChange = false;
2015-03-27 11:23:30 731
原创 编译原理 总结
一、 编译程序1、 编译器是一种翻译程序,它用于将源语言(即用某种程序设计语言写成的)程序翻译为目标语言(即用二进制数表示的伪机器代码写成的)程序。后者在windows操作系统平台下,其文件的扩展名通常为.obj。该文件通常还要经过进一步的连接,生成可执行文件(机器代码写成的程序,文件扩展名为.exe)。通常有两种方式进行这种翻译,一种是编译,另一种是解释。后者并不生成可执行文件,只是翻译一条语句
2015-03-26 17:36:07 34216 1
原创 数据结构 总结
1、常见的时间复杂度 O(1) < O(logn) < O (n) < O(n^2) < O(n^3) < O(2^n) < O(n!) < O(n^n) 2、循环队列队列满的条件 (rear + 1) % size == front 队列长度计算公式 (rear - front + size) % size 3、两栈共享空间栈满计算公式 top1 + 1 == top2 4、串模
2015-03-26 16:43:09 688
原创 [leetcode]26 Minimum Depth of Binary Tree
题目链接:https://leetcode.com/problems/minimum-depth-of-binary-tree/ Runtimes:16ms1、问题Given a binary tree, find its minimum depth. The minimum depth is the number of nodes along the shortest path from th
2015-03-11 14:17:38 445
原创 [leetcode]25 Number of 1 Bits
题目链接:https://leetcode.com/problems/number-of-1-bits/ Runtimes:10ms1、问题Write a function that takes an unsigned integer and returns the number of ’1’ bits it has (also known as the Hamming weight). For
2015-03-11 13:55:27 509
原创 [leetcode]24 Path Sum II
题目链接:https://leetcode.com/problems/path-sum-ii/ Runtimes:93ms 1、问题 Given a binary tree and a sum, find all root-to-leaf paths where each path’s sum equals the given sum. For example: Given the be
2015-03-11 13:45:32 390
原创 [leetcode]23 Path Sum
题目链接:https://leetcode.com/problems/path-sum/ Runtimes:201、问题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 gi
2015-03-11 12:16:57 533
原创 [leetcode]22 Binary Tree Level Order Traversal
题目链接:https://leetcode.com/problems/binary-tree-level-order-traversal/ Runtimes:9ms1、问题Given a binary tree, return the level order traversal of its nodes’ values. (ie, from left to right, level by leve
2015-03-10 16:46:25 371
原创 [leetcode]21 Maximum Depth of Binary Tree
题目链接:https://leetcode.com/problems/maximum-depth-of-binary-tree/ Runtimes:16ms1、问题Given a binary tree, find its maximum depth. The maximum depth is the number of nodes along the longest path from the
2015-03-10 16:17:04 465
原创 [leetcode]20 Pascals Triangle I
题目链接:https://leetcode.com/problems/pascals-triangle/ Runtimes:3ms1、问题Given numRows, generate the first numRows of Pascal’s triangle.For example, given numRows = 5, Return [ [1], [1,1
2015-03-10 11:13:32 596
原创 [leetcode]19 Pascal's Triangle II
题目链接:https://leetcode.com/problems/pascals-triangle-ii/ Runtimes:3ms1、问题Given an index k, return the kth row of the Pascal’s triangle. For example, given k = 3, Return [1,3,3,1]. Note: Could you
2015-03-10 10:56:39 485
原创 [leetcode]18 Min Stack
题目链接:https://leetcode.com/problems/min-stack/ Runtimes:71ms1、问题Design a stack that supports push, pop, top, and retrieving the minimum element in constant time. push(x) – Push element x onto stack.
2015-03-09 17:22:35 349
原创 [leetcode]17 Intersection of Two Linked Lists
题目链接:https://oj.leetcode.com/problems/intersection-of-two-linked-lists/ Runtimes:81ms1、问题Write a program to find the node at which the intersection of two singly linked lists begins. For example, the
2015-03-08 11:35:09 379
原创 [leetcode]16 Valid Palindrome
题目连接:https://oj.leetcode.com/problems/valid-palindrome/ Runtimes:16ms1、问题Given a string, determine if it is a palindrome, considering only alphanumeric characters and ignoring cases. For example, “
2015-03-07 09:38:23 468
原创 [leetcode]15 Compare Version Numbers
题目链接:https://oj.leetcode.com/problems/compare-version-numbers/ Runtimes:2ms1、问题ompare two version numbers version1 and version2. If version1 > version2 return 1, if version1 < version2 return -1, oth
2015-03-06 20:41:03 345
原创 [leetcode]14 Excel Sheet Column Title
题目连接:https://oj.leetcode.com/problems/excel-sheet-column-title/ Runtimes:1ms1、问题Given a positive integer, return its corresponding column title as appear in an Excel sheet. For example: 1 -> A
2015-03-06 16:53:06 458
原创 [leetcode]13 Majority Element
题目链接:https://oj.leetcode.com/problems/majority-element/ Runtimes:48ms1、问题Given an array of size n, find the majority element. The majority element is the element that appears more than ⌊ n/2 ⌋ times.
2015-03-06 15:24:13 424
原创 [leetcode]12 Excel Sheet Column Number
题目链接:https://oj.leetcode.com/problems/excel-sheet-column-number/ Runtimes:16ms1、问题Related to question Excel Sheet Column Title Given a column title as appear in an Excel sheet, return its correspondi
2015-03-05 15:56:24 457
原创 [Leetcode]11 Rotate Array
Rotate Array题目连接:https://oj.leetcode.com/problems/rotate-array/ Runtimes:26ms1、问题Rotate an array of n elements to the right by k steps. For example, with n = 7 and k = 3, the array [1,2,3,4,5,6,7] is
2015-03-05 12:00:24 534
TCP/IP详解·卷2:实现
2015-10-30
深度探索C++对象模型
2015-10-30
The Science Of Programming
2015-10-30
深入理解计算机系统
2015-10-30
SQL 练习题 样例
2015-10-05
数据库系统概论(第四版)王珊等 扫描版
2015-10-04
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人