CHuiL

31. Next Permutation

leetcode

题目 Implement next permutation, which rearranges numbers into the lexicographically next greater permutation of numbers. If such arrangement is not possible, it must rearrange it as the lowest poss...

使用kubeadm来部署k8s集群

k8s学习记录

查看linux系统信息 查看内核版本信息 cat /proc/version Linux version 4.4.0-150-generic (buildd@lgw01-amd64-036) (gcc version 5.4.0 20160609 (Ubuntu 5.4.0-6ubuntu1~16.04.10) ) #176-Ubuntu SMP Wed May 29 18:56:26 UT...

Elasticsearch 的数据存储和索引

倒排索引 elasticsearch底层是使用Lucene的倒排索引技术来实现比关系型数据库更快的过滤,在了解什么是倒排索引之前,先明白几个关键词的意思。 index:索引,在倒排索引里一个index就相当于一个数据库。 document:文档,一个文档归属一个索引下面,有自己的docId。相当于一条数据。 field:字段,一个文档由多个字段组成。 term:字段的内容,就是某个fie...

34. Find First and Last Position of Element in Sorted Array

leetcode

题目 Given an array of integers nums sorted in ascending order, find the starting and ending position of a given target value. Your algorithm’s runtime complexity must be in the order of O(log n). ...

406. Queue Reconstruction by Height

leetcode

题目 Suppose you have a random list of people standing in a queue. Each person is described by a pair of integers (h, k), where h is the height of the person and k is the number of people in front of...

416. Partition Equal Subset Sum

leetcode

题目 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 both subsets is equal. Note: Each of the ar...

114. Flatten Binary Tree to Linked List

leetcode

题目 Given a binary tree, flatten it to a linked list in-place. For example, given the following tree: 1 / \ 2 5 / \ \ 3 4 6 The flattened tree should look like: 1 \ 2 \ ...

22. Generate Parentheses

leetcode

题目 Given n pairs of parentheses, write a function to generate all combinations of well-formed parentheses. For example, given n = 3, a solution set is: 题意 给定一个数字n,求出n个括号的正确组合方式 例子 [ "((()))", ...

49. Group Anagrams

leetcode

题目 Given an array of strings, group anagrams together. 题意 给定一个字符串数组,将其中颠倒字母而成的字(anagrams),即字母是相同的,但是是不同顺序的字符串放在同一个数组中返回。 例子 Input: ["eat", "tea", "tan", "ate", "nat", "bat"], Output: [ ["ate","...

338. Counting Bits

leetcode

题目 Given a non negative integer number num. For every numbers i in the range 0 ≤ i ≤ num calculate the number of 1’s in their binary representation and return them as an array. 题意 给定一个数字num,求0<...