自定义博客皮肤VIP专享

*博客头图:

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

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

博客底图:

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

栏目图:

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

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

-+
  • 博客(23)
  • 收藏
  • 关注

原创 CPU Frequency scaling CPU频率的修改方法

用cpupower工具修改,但是在修改过程中会遇到ERROR: [root@wyx~]# cpupower frequency-info analyzing CPU 0:   driver: intel_pstate   CPUs which run at the same hardware frequency: 0   CPUs which need to have their frequenc...

2018-06-04 10:55:20 13253 1

原创 剑指offer-和为S的连续正数序列

题目描述小明很喜欢数学,有一天他在做数学作业时,要求计算出9~16的和,他马上就写出了正确答案是100。但是他并不满足于此,他在想究竟有多少种连续的正数序列的和为100(至少包括两个数)。没多久,他就得到另一组连续正数和为100的序列:18,19,20,21,22。现在把问题交给你,你能不能也很快的找出所有和为S的连续正数序列? Good Luck!输出描述:输出所有和为S的连续正数序列。序列内按...

2018-05-31 13:04:00 210

原创 剑指offer-平衡二叉树

判断是否为平衡二叉树输入一棵二叉树,判断该二叉树是否是平衡二叉树。平衡二叉树:平衡二叉搜索树(Self-balancing binary search tree)又被称为AVL树(有别于AVL算法),且具有以下性质:它是一 棵空树或它的左右两个子树的高度差的绝对值不超过1,并且左右两个子树都是一棵平衡二叉树。用到递归求树高度的方法。public class Solution { priva...

2018-05-28 10:35:17 223

原创 剑指offer-构建乘积数组

构建乘积数组题目描述给定一个数组A[0,1,...,n-1],请构建一个数组B[0,1,...,n-1],其中B中的元素B[i]=A[0]*A[1]*...*A[i-1]*A[i+1]*...*A[n-1]。不能使用除法。import java.util.ArrayList;public class Solution { public int[] multiply(int[] A) {...

2018-05-28 09:57:49 319

原创 LeetCode 76. Minimum Window Substring 最小窗口子串

Given a string S and a string T, find the minimum window in S which will contain all the characters in T in complexity O(n).Example:Input: S = "ADOBECODEBANC", T = "ABC"Output: "BANC"Note:If there i...

2018-05-08 20:57:44 195

原创 LeetCode 187. Repeated DNA Sequences 重复的DNA序列

All DNA is composed of a series of nucleotides abbreviated as A, C, G, and T, for example: "ACGAATTCCG". When studying DNA, it is sometimes useful to identify repeated sequences within the DNA.Write a...

2018-05-08 19:44:02 803

原创 LeetCode 3. Longest Substring Without Repeating Characters 无重复字符的最长子串

Given a string, find the length of the longest substring without repeating characters.Examples:Given "abcabcbb", the answer is "abc", which the length is 3.Given "bbbbb", the answer is "b", with the l...

2018-05-08 18:12:39 171

原创 LeetCode 49. Group Anagrams 同字符词语分组

Given an array of strings, group anagrams together.Example:Input: ["eat", "tea", "tan", "ate", "nat", "bat"],Output:[ ["ate","eat","tea"], ["nat",&amp

2018-05-08 15:41:15 288

原创 LeetCode 290. Word Pattern 单词匹配

Question:Given a pattern and a string str, find if str follows the same pattern.Here follow means a full match, such that there is a bijection between a letter in pattern and a non-empty word in str.E...

2018-05-08 15:05:56 307

原创 LeetCode 409. Longest Palindrome 最长回文字串

Question:Given a string which consists of lowercase or uppercase letters, find the length of the longest palindromes that can be built with those letters.This is case sensitive, for example "Aa" is no...

2018-05-08 14:04:32 173

原创 LeetCode 207. Course Schedule 课程安排表

There are a total of n courses you have to take, labeled from 0 to n-1.Some courses may have prerequisites, for example to take course 0 you have to first take course 1, which is expressed as a pair: ...

2018-05-07 20:27:59 343

原创 数据结构-图的邻接矩阵表示

图有两种表示方式:一为邻接矩阵,一为邻接表。用邻接矩阵表示图方式如下:邻接矩阵表示图的类:import java.util.ArrayList;import java.util.LinkedList;/** * @description 邻接矩阵模型类 */public class Graph_matrix { private ArrayList vertexList;//存储点...

2018-05-07 17:29:59 1752

原创 LeetCode 376. Wiggle Subsequence 摇摆序列

Question:A sequence of numbers is called a wiggle sequence if the differences between successive numbers strictly alternate between positive and negative. The first difference (if one exists) may be e...

2018-04-22 18:21:21 385

原创 LeetCode 452. Minimum Number of Arrows to Burst Balloons 射击气球所需最少弓箭手数量

Question:There are a number of spherical balloons spread in two-dimensional space. For each balloon, provided input is the start and end coordinates of the horizontal diameter. Since it's horizontal, ...

2018-04-22 18:12:22 408

原创 LeetCode 45. Jump Game II 跳跃游戏2

Question:Given an array of non-negative integers, you are initially positioned at the first index of the array.Each element in the array represents your maximum jump length at that position.Your goal ...

2018-04-22 17:04:50 302

原创 LeetCode 55. Jump Game 跳跃游戏

Question:Given an array of non-negative integers, you are initially positioned at the first index of the array.Each element in the array represents your maximum jump length at that position.Determine ...

2018-04-22 15:28:42 834

原创 LeetCode 402. Remove K Digits 除去K个数,使得结果最小

Question:Given a non-negative integer num represented as a string, remove k digits from the number so that the new number is the smallest possible.Note:The length of num is less than 10002 and will be...

2018-04-20 18:31:24 333

原创 LeetCode 455. Assign Cookies 分饼干

Question:Assume you are an awesome parent and want to give your children some cookies. But, you should give each child at most one cookie. Each child i has a greed factor gi, which is the minimum size...

2018-04-19 19:34:53 262

原创 LeetCode 295. Find Median from Data Stream 从数据流中寻找中位数

Question:Median is the middle value in an ordered integer list. If the size of the list is even, there is no middle value. So the median is the mean of the two middle value.Examples: [2,3,4] , the med...

2018-04-19 19:26:57 254

原创 LeetCode.215 Kth Largest Element in an Array 返回数组中第K大的数

Question:Find the kth largest element in an unsorted array. Note that it is the kth largest element in the sorted order, not the kth distinct element.For example,Given [3,2,1,5,6,4] and k = 2, return ...

2018-04-19 14:53:20 168

原创 LeetCode 155. Min Stack 返回栈中最小值

Question:Design a stack that supports push, pop, top, and retrieving the minimum element in constant time.push(x) -- Push element x onto stack.pop() -- Removes the element on top of the stack.top() --...

2018-04-19 14:09:47 180

原创 LeetCode 225. Implement Stack using Queues 用队列实现栈

Question:Implement the following operations of a stack using queues.push(x) -- Push element x onto stack.pop() -- Removes the element on top of the stack.top() -- Get the top element.empty() -- Return...

2018-04-19 13:44:08 139

原创 LeetCode 232. Implement Queue using Stacks 用栈实现队列

Question:Implement the following operations of a queue using stacks.push(x) -- Push element x to the back of queue.pop() -- Removes the element from in front of queue.peek() -- Get the front element.e...

2018-04-19 13:33:54 264

空空如也

空空如也

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

TA关注的人

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