自定义博客皮肤VIP专享

*博客头图:

格式为PNG、JPG,宽度*高度大于1920*100像素,不超过2MB,主视觉建议放在右侧,请参照线上博客头图

请上传大于1920*100像素的图片!

博客底图:

图片格式为PNG、JPG,不超过1MB,可上下左右平铺至整个背景

栏目图:

图片格式为PNG、JPG,图片宽度*高度为300*38像素,不超过0.5MB

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

-+
  • 博客(96)
  • 资源 (4)
  • 收藏
  • 关注

原创 字符串的全排列

题目描述 输入一个字符串,打印出该字符串中字符的全排列。解法一:递归实现  从未打印字符中选择一个打印,递归打印剩余字符。具体实现:将要打印的字符移动到剩余字符串的头部,递归至没有剩余字符时一起全部打印。 C++代码:void permutation(string &str, int start){ if (start == str.size()) { cout <<

2015-12-24 19:12:00 482

原创 字符串的包含

题目描述 给定一个字符串a和一短字符串b,只包含小写字母,判断b中元素是否都在a中?a是”abcd”,b是”bad”,答案是truea是”abcd”,b是”bce”,答案是falsea是”abcd”,b是”aa”,答案是true解法一:蛮力轮询 轮询字符串b中每个字符,逐一与a中字符比较。 时间复杂度:O(nm); 空间复杂度:O(1)C++代码:bool stringContain_

2015-12-24 00:33:41 1033 1

原创 字符串的旋转

题目描述给定一个字符串,要求将字符串的前若干(m)位字符移动到字符串的尾部。**例如**:将字符串"abcdef"的前3个字符'a'、'b'和'c'移到字符串的尾部,得到"defabc"。解法一:n轮移动,每轮中将每个字符左移一位。 时间复杂度:O(mn); 空间复杂度:O(1)void leftRotateString_1(string &str, int m){ if (m <

2015-12-23 00:19:00 568

原创 06-图4. Saving James Bond - Hard Version (30)

06-图4. Saving James Bond - Hard Version (30)时间限制400 ms内存限制65536 kB代码长度限制8000 B判题程序Standard作者CHEN, YueThis time let us consider

2015-08-25 18:06:03 1469

原创 05-图3. 六度空间 (30)

05-图3. 六度空间 (30)时间限制1500 ms内存限制65536 kB代码长度限制8000 B判题程序Standard“六度空间”理论又称作“六度分隔(Six Degrees of Separation)”理论。这个理论可以通俗地阐述为:“你和任何一个陌生人之间所

2015-07-26 16:58:39 1252

原创 05-图2. Saving James Bond - Easy Version (25)

05-图2. Saving James Bond - Easy Version (25)时间限制200 ms内存限制65536 kB代码长度限制8000 B判题程序Standard作者CHEN, YueThis time let us consider

2015-07-26 00:21:01 1665 2

原创 05-图1. List Components (25)

05-图1. List Components (25)时间限制200 ms内存限制65536 kB代码长度限制8000 B判题程序Standard作者CHEN, YueFor a given undirected graph with N vertic

2015-07-25 16:58:26 840

原创 04-树9. Path in a Heap (25)

04-树9. Path in a Heap (25)时间限制150 ms内存限制65536 kB代码长度限制8000 B判题程序Standard作者CHEN, YueInsert a sequence of given numbers into an

2015-07-25 10:59:50 636

原创 04-树8. Complete Binary Search Tree (30)

04-树8. Complete Binary Search Tree (30)时间限制100 ms内存限制65536 kB代码长度限制8000 B判题程序Standard作者CHEN, YueA Binary Search Tree (BST) is

2015-07-25 10:21:11 617

原创 04-树7. Search in a Binary Search Tree (25)

04-树7. Search in a Binary Search Tree (25)时间限制100 ms内存限制65536 kB代码长度限制8000 B判题程序Standard作者CHEN, YueTo search a key in a binary

2015-07-25 09:43:26 703

原创 04-树6. Huffman Codes (30)

04-树6. Huffman Codes (30)时间限制200 ms内存限制65536 kB代码长度限制8000 B判题程序Standard作者CHEN, YueIn 1953, David A. Huffman published his pape

2015-07-25 09:15:53 2784 1

原创 04-树5. File Transfer (25)

04-树5. File Transfer (25)时间限制150 ms内存限制65536 kB代码长度限制8000 B判题程序Standard作者CHEN, YueWe have a network of computers and a list of

2015-07-22 22:29:37 1278

原创 04-树4. Root of AVL Tree (25)

04-树4. Root of AVL Tree (25)时间限制100 ms内存限制65536 kB代码长度限制8000 B判题程序Standard作者CHEN, YueAn AVL tree is a self-balancing binary se

2015-07-22 20:34:51 1386

原创 03-树3. Tree Traversals Again (25)

03-树3. Tree Traversals Again (25)时间限制200 ms内存限制65536 kB代码长度限制8000 B判题程序Standard作者CHEN, YueAn inorder binary tree traversal can

2015-07-22 09:58:11 2565 1

原创 03-树2. List Leaves (25)

03-树2. List Leaves (25)时间限制400 ms内存限制65536 kB代码长度限制8000 B判题程序Standard作者CHEN, YueGiven a tree, you are supposed to list all the

2015-07-20 22:33:27 3126

原创 03-树1. 二分法求多项式单根(20)

03-树1. 二分法求多项式单根(20)时间限制400 ms内存限制65536 kB代码长度限制8000 B判题程序Standard作者杨起帆(浙江大学城市学院)二分法求函数根的原理为:如果连续函数f(x)在区间[a, b]的两个端点取值异号,即f(a

2015-07-20 21:09:10 445

原创 02-线性结构3. 求前缀表达式的值(25)

02-线性结构3. 求前缀表达式的值(25)时间限制400 ms内存限制65536 kB代码长度限制8000 B判题程序Standard算术表达式有前缀表示法、中缀表示法和后缀表示法等形式。前缀表达式指二元运算符位于两个运算数之前,例如2+3*(7-4)+8/4的前缀表达

2015-07-20 20:13:41 1013

原创 #29 Divide Two Integers

题目链接:https://leetcode.com/problems/divide-two-integers/Divide two integers without using multiplication, division and mod operator.If it is overflow, return MAX_INT.int divide(in

2015-07-19 22:53:41 519

原创 #28 Implement strStr()

题目链接:https://leetcode.com/problems/implement-strstr/Implement strStr().Returns the index of the first occurrence of needle in haystack, or -1 if needle is not part of haystack.Update

2015-07-19 19:31:57 390

原创 #27 Remove Element

题目链接:https://leetcode.com/problems/remove-element/Given an array and a value, remove all instances of that value in place and return the new length.The order of elements can be changed.

2015-07-19 17:13:21 591

原创 #26 Remove Duplicates from Sorted Array

题目链接:https://leetcode.com/problems/remove-duplicates-from-sorted-array/Given a sorted array, remove the duplicates in place such that each element appear only once and return the new length.

2015-07-19 17:04:28 557

原创 #25 Reverse Nodes in k-Group

题目链接:https://leetcode.com/problems/reverse-nodes-in-k-group/Given a linked list, reverse the nodes of a linked list k at a time and return its modified list.If the number of nodes is not

2015-07-19 16:53:09 492

原创 #24 Swap Nodes in Pairs

题目链接:https://leetcode.com/problems/swap-nodes-in-pairsGiven 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

2015-07-18 23:08:57 422

原创 #23 Merge k Sorted Lists

题目链接:https://leetcode.com/problems/merge-k-sorted-lists/Merge k sorted linked lists and return it as one sorted list. Analyze and describe its complexity./** * Definition for singly-l

2015-07-18 23:03:45 522

原创 #22 Generate Parentheses

题目链接:https://leetcode.com/problems/generate-parentheses/Given n pairs of parentheses, write a function to generate all combinations of well-formed parentheses.For example, given n = 3, a

2015-07-14 16:41:36 580

原创 #21 Merge Two Sorted Lists

题目链接:https://leetcode.com/problems/merge-two-sorted-lists/Merge two sorted linked lists and return it as a new list. The new list should be made by splicing together the nodes of the first two

2015-07-14 14:57:50 566

原创 #20 Valid Parentheses

题目链接:https://leetcode.com/problems/valid-parentheses/Given a string containing just the characters '(', ')','{', '}', '[' and ']', determine if the input string is valid.The brackets m

2015-07-14 14:54:57 492

原创 #19 Remove Nth Node From End of List

题目链接:https://leetcode.com/problems/remove-nth-node-from-end-of-list/Given a linked list, remove the nth node from the end of list and return its head.For example, Given linked list:

2015-07-14 12:43:38 583

原创 #18 4Sum

题目链接:https://leetcode.com/problems/4sum/依次将问题转化为3Sum、2Sum问题, 后两个问题解法见关联博文。/** * Return an array of arrays of size *returnSize. * Note: The returned array must be malloced, assume caller calls fr

2015-07-14 11:39:51 647

原创 #17 Letter Combinations of a Phone Number

题目链接:https://leetcode.com/problems/letter-combinations-of-a-phone-number/Given a digit string, return all possible letter combinations that the number could represent.A mapping of digit to l

2015-07-14 08:30:32 613

原创 #16 3Sum Closest

题目链接:https://leetcode.com/problems/3sum-closest/Given an array S of n integers, find three integers in S such that the sum is closest to a given number, target. Return the sum of the three i

2015-06-22 16:52:23 592

原创 #15 3Sum

题目链接:https://leetcode.com/problems/3sum/Given an array S of n integers, are there elements a, b, c in S such that a + b + c = 0? Find all unique triplets in the array which gives the sum o

2015-06-22 16:27:12 574

原创 #14 Longest Common Prefix

题目链接:https://leetcode.com/problems/longest-common-prefix/Write a function to find the longest common prefix string amongst an array of strings.char* longestCommonPrefix(char** strs, int

2015-06-21 21:50:02 427

原创 #13 Roman to Integer

题目链接:https://leetcode.com/problems/roman-to-integer/Given a roman numeral, convert it to an integer.Input is guaranteed to be within the range from 1 to 3999.int Digit(char ch) {

2015-06-21 21:22:28 394

原创 #12 Integer to Roman

题目链接:https://leetcode.com/problems/integer-to-roman/Given an integer, convert it to a roman numeral.Input is guaranteed to be within the range from 1 to 3999.char* intToRoman(int

2015-06-21 21:20:36 411

原创 #11 Container With Most Water

原题链接:https://leetcode.com/problems/container-with-most-water/Given n non-negative integers a1, a2, ..., an, where each represents a point at coordinate (i, ai). n vertical lines are draw

2015-06-21 18:24:27 434

原创 #10 Regular Expression Match

题目链接:https://leetcode.com/problems/regular-expression-matching/Implement regular expression matching with support for '.' and '*'.'.' Matches any single character.'*' Matches zero or more

2015-06-21 16:04:11 555

原创 #9 Palindrome Number

题目链接:https://leetcode.com/problems/palindrome-number/Determine whether an integer is a palindrome. Do this without extra space.click to show spoilers.Some hints:Could negative inte

2015-06-21 13:48:11 554

原创 #8 String to Integer (atoi)

题目链接:https://leetcode.com/problems/string-to-integer-atoi/Implement atoi to convert a string to an integer.Hint: Carefully consider all possible input cases. If you want a challenge, ple

2015-06-21 13:31:10 523

原创 #7 Reverse Integer

题目链接:https://leetcode.com/problems/reverse-integer/Reverse digits of an integer.Example1: x = 123, return 321Example2: x = -123, return -321click to show spoilers.Have you thou

2015-06-21 13:29:01 341

WebGoat 中文手册

学习Web应用漏洞最好的教程——WebGoat WebGoat中文手册,可以配合英文版软件学习

2015-01-17

操作系统中文版七版(全) + 英文版9版(part2)

操作系统中文版第一版 英文版第九版 全是完整的 上传文件大小受限分成两个压缩包

2014-12-25

操作系统中文版七版(全) + 英文版9版(part1)

操作系统中文版第一版 英文版第九版 全是完整的 上传文件大小受限分成两个压缩包

2014-12-25

空空如也

TA创建的收藏夹 TA关注的收藏夹

TA关注的人

提示
确定要删除当前文章?
取消 删除