自定义博客皮肤VIP专享

*博客头图:

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

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

博客底图:

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

栏目图:

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

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

-+

原创 Leetcode 213. 打家劫舍 II

你是一个专业的小偷,计划偷窃沿街的房屋,每间房内都藏有一定的现金。这个地方所有的房屋都围成一圈,这意味着第一个房屋和最后一个房屋是紧挨着的。同时,相邻的房屋装有相互连通的防盗系统,如果两间相邻的房屋在同一晚上被小偷闯入,系统会自动报警。 给定一个代表每个房屋存放金额的非负整数数组,计算你在不触动...

2020-03-29 21:46:19 24 0

转载 mysql double write

转自:https://www.cnblogs.com/cchust/p/3961260.html mysql double write (二次写)是mysql innodb存储引擎的一个重要特性,本人这两天翻阅了相关的资料,结合自己已有的知识,说说自己对double write的理解,供各位...

2020-01-10 16:40:57 29 0

转载 Java8内存模型—永久代(PermGen)和元空间(Metaspace)

转自https://ww 一、JVM 内存模型   根据 JVM 规范,JVM 内存共分为虚拟机栈、堆、方法区、程序计数器、本地方法栈五个部分。   1、虚拟机栈:每个线程有一个私有的栈,随着线程的创建而创建。栈里面存着的是一种叫“栈帧”的东西,每个方法会创建一个栈帧,栈帧中存放了局部变...

2019-03-23 16:18:09 56 0

原创 leetcode: 560. Subarray Sum Equals K DescriptionHintsSubmissionsDiscussSolution Given an array of in

560. Subarray Sum Equals K DescriptionHintsSubmissionsDiscussSolution Pick One Given an array of integers and an integer k, you need to find the t...

2018-10-12 00:05:36 105 0

原创 leetcode 147. Insertion Sort List

Sort a linked list using insertion sort. A graphical example of insertion sort. The partial sorted list (black) initially contains only the first e...

2018-10-10 00:01:54 62 0

原创 leetcode 103. Binary Tree Zigzag Level Order Traversal

Given a binary tree, return the zigzag level order traversal of its nodes' values. (ie, from left to right, then right to left for the next leve...

2018-09-16 14:59:22 59 0

原创 leetcode 102. Binary Tree Level Order Traversal

Given a binary tree, return the level order traversal of its nodes' values. (ie, from left to right, level by level). For example: Given binary...

2018-09-16 14:15:08 50 0

原创 leetcode: 316. Remove Duplicate Letters

Given a string which contains only lowercase letters, remove duplicate letters so that every letter appear once and only once. You must make sure you...

2018-09-16 08:03:13 81 0

原创 leetcode 228. Summary Ranges

Given a sorted integer array without duplicates, return the summary of its ranges. Example 1: Input: [0,1,2,4,5,7] Output: ["0->2&quo...

2018-09-10 19:26:09 38 0

原创 leetcode: 334. Increasing Triplet Subsequence

Given an unsorted array return whether an increasing subsequence of length 3 exists or not in the array. Formally the function should: Return true ...

2018-09-09 23:08:39 44 0

转载 hbase的行锁与多版本并发控制(MVCC)

http://san-yun.iteye.com/blog/2156663 参考:http://www.rigongyizu.com/hbase-row-lock-and-multiversion-concurrency-control/   MVCC (Multiversion Concu...

2018-09-08 17:11:49 91 0

原创 leetcode:Palindromic Substrings

Given a string, your task is to count how many palindromic substrings in this string. The substrings with different start indexes or end indexes are...

2018-08-13 07:31:30 51 0

原创 leetcode 279. Perfect Squares

Given a positive integer n, find the least number of perfect square numbers (for example, 1, 4, 9, 16, ...) which sum to n. Example 1: Input: n = ...

2018-08-12 18:51:27 50 0

原创 leetcode: 115. Distinct Subsequences

Given a string S and a string T, count the number of distinct subsequences of S which equals T. A subsequence of a string is a new string which is f...

2018-08-12 08:05:12 54 0

原创 leetcode:813. Largest Sum of Averages(DP)

We partition a row of numbers A into at most K adjacent (non-empty) groups, then our score is the sum of the average of each group. What is the large...

2018-08-11 14:58:37 79 0

原创 leetcode 129. Sum Root to Leaf Numbers

Given a binary tree containing digits from 0-9 only, each root-to-leaf path could represent a number. An example is the root-to-leaf path 1->...

2018-08-08 00:18:48 43 0

原创 [leetcode] 116 Populating Next Right Pointers in Each Node

iven a binary tree struct TreeLinkNode { TreeLinkNode *left; TreeLinkNode *right; TreeLinkNode *next; } Populate each next pointer to point...

2018-08-07 23:49:39 47 0

转载 Java 并发 --- 非阻塞队列之ConcurrentLinkedQueue源码分析

转自:https://blog.csdn.net/u014634338/article/details/78825440在并发编程中,有时候需要使用线程安全的队列,如果要实现一个线程安全的队列有两种方式:一种是使用阻塞算法,另一种是使用非阻塞算法,在前面我们逐一分析过阻塞队列,这篇文章过后,会写篇...

2018-05-20 17:57:02 236 0

转载 Spark创建DataFrame的三种方法

转自:https://vimsky.com/article/2708.html跟关系数据库的表(Table)一样,DataFrame是Spark中对带模式(schema)行列数据的抽象。DateFrame广泛应用于使用SQL处理大数据的各种场景。创建DataFrame有很多种方法,比如从本地Lis...

2018-03-29 20:27:22 18786 0

转载 深夜学算法之SkipList:让链表飞

转自:https://www.jianshu.com/p/fcd18946994e1. 前言上次写Python操作LevelDB时提到过,有机会要实现下SkipList。摘录下wiki介绍:跳跃列表是一种随机化数据结构,基于并联的链表,其效率可比拟二叉查找树。我们知道对于有序链表,查找的时间复杂度...

2018-03-29 13:49:58 137 0

原创 判断是否正确的出栈顺序

bool isOK(int *arr, int len) { stack<int> auxStack; int i = 0; // the index for the arr int j = 1; // the number in seq 1,2,3,4,5 ...

2018-02-27 15:11:20 233 0

转载 堆排序

http://blog.csdn.net/zdp072/article/details/44227317 [算法说明] 堆排序是对简单选择排序的改进 简单选择排序是从n个记录中找出一个最小的记录,需要比较n-1次。但是这样的操作并没有把每一趟的比较结果保存下来,在后一...

2017-11-22 01:18:11 141 0

转载 理解TIME_WAIT

转自 www.firefoxbug.com/index.php/archives/2795/ 前言 TIME_WAIT 是在TCP协议中很模糊的概念,它可能使socke能陷入的一种时间相对比较长的状态,过多的TIME_WAIT会影响新socket的建立。TIME...

2017-11-20 21:48:14 153 0

转载 N的结成

转自:http://blog.csdn.net/liyong199012/article/details/40341779 题目:求100! 这看起来是一个很简答的问题,递归解之毫无压力 [java] view plain copy ...

2017-11-06 15:34:42 190 0

转载 POJ 1019 Number Sequence【数论】

转自 http://www.cnblogs.com/Hilda/archive/2012/08/17/2644739.html Description A single positive integer i is given. Write a program to find...

2017-10-27 10:20:49 183 0

原创 lintcode: Count of Smaller Number

Give you an integer array (index from 0 to n-1, where n is the size of this array, value from 0 to 10000) and an query list. For each query, give you...

2017-07-03 23:17:02 277 0

原创 lintcode: Insert Delete GetRandom O(1)

Design a data structure that supports all following operations in average O(1)time. insert(val): Inserts an item val to the set if not already p...

2017-07-02 01:24:52 200 0

原创 lintcode: Dices Sum

Throw n dices, the sum of the dices' faces is S. Given n, find the all possible value of S along with its probability.  Notice You do no...

2017-07-02 00:11:32 211 0

原创 lintcode: Partition Equal Subset Sum

Given a non-empty array containing only positive integers, find if the array can be partitioned into two subsets such that the sum of elements in...

2017-06-30 00:47:45 230 0

原创 Perfect Squares

Given a positive integer n, find the least number of perfect square numbers (for example, 1, 4, 9, 16, ...) which sum to n. Have you met thi...

2017-06-29 23:34:23 158 0

原创 深度探索C++对象模型

根据这个图片我们可以看出,对于虚继承体系来说,任何一个对象的构造执行顺序总是从深到浅、从远到近,既最先构造的总是最底层的基类。       这样看起来似乎并没有什么值得奇怪的地方,但是让我们想想,如果我们把主函数main中的代码改成【Point3d p3d;】呢?相信按下F5后,会输出两句执...

2016-11-06 14:06:12 279 0

转载 Miko Android自学之路 WifiDirect中文最强详解,如何传输数据,如何设置GroupOwener,如何设置客户端以及服务器端

转自 http://blog.csdn.net/mikogodzd/article/details/50965178

2016-05-15 00:50:10 323 0

转载 lintcode:Minimum Adjustment Cost

Given an integer array, adjust each integers so that the difference of every adjacent integers are not greater than a given number target. If the ar...

2016-04-06 19:47:00 391 0

原创 lintcode:Word Search II

Given a matrix of lower alphabets and a dictionary. Find all words in the dictionary that can be found in the matrix. A word can start from any pos...

2016-04-06 17:43:28 215 0

原创 lintcode:Copy Books

Given an array A of integer with size of n( means n books and number of pages of each book) and k people to copy the book. You must distribute the co...

2016-04-06 15:03:17 577 0

转载 leetcode:排序数组之后相邻数的最大差

https://leetcode.com/discuss/27754/my-c-code-12-ms-bucket-sort-o-n-time-and-space The key is to use the fact that the lower bound of the g...

2016-04-05 00:53:36 941 0

原创 lintcode:Unique Binary Search Trees II

Given n, generate all structurally unique BST's (binary search trees) that store values 1...n. Have you met this question in a real inter...

2016-04-03 22:19:56 222 0

原创 lintcode: Unique Binary Search Trees

Given n, how many structurally unique BSTs (binary search trees) that store values 1...n? Have you met this question in a real interview? E...

2016-04-03 21:51:24 486 0

原创 lintcode:Remove Duplicates from Sorted List II

Given a sorted linked list, delete all nodes that have duplicate numbers, leaving only distinct numbers from the original list. Have you met this...

2016-04-03 21:04:50 171 0

原创 lintcode:Sort Colors II

Given an array of n objects with k different colors (numbered from 1 to k), sort them so that objects of the same color are adjacent, with the colors...

2016-04-03 20:33:35 221 0

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