自定义博客皮肤VIP专享

*博客头图:

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

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

博客底图:

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

栏目图:

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

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

-+
  • 博客(31)
  • 资源 (2)
  • 收藏
  • 关注

原创 169. Majority Element

Given an array of size n, find the majority element. The majority element is the element that appears more than ⌊ n/2 ⌋ times.You may assume that the array is non-empty and the majority element always...

2018-05-29 18:42:40 135

原创 167. Two Sum II - Input array is sorted

Given an array of integers that is already sorted in ascending order, find two numbers such that they add up to a specific target number.The function twoSum should return indices of the two numbers su...

2018-05-29 18:41:02 154

原创 717. 1-bit and 2-bit Characters

We have two special characters. The first character can be represented by one bit 0. The second character can be represented by two bits (10 or 11). Now given a string represented by several bits. Re...

2018-05-29 18:38:07 159

原创 566. Reshape the Matrix

In MATLAB, there is a very useful function called 'reshape', which can reshape a matrix into a new one with different size but keep its original data.You're given a matrix represented by a two-dimensi...

2018-05-28 16:05:51 140

原创 766. Toeplitz Matrix

A matrix is Toeplitz if every diagonal from top-left to bottom-right has the same element.Now given an M x N matrix, return True if and only if the matrix is Toeplitz. Example 1:Input: matrix = [[1,2,...

2018-05-28 14:07:50 143

原创 561. Array Partition I

Given an array of 2n integers, your task is to group these integers into n pairs of integer, say (a1, b1), (a2, b2), ..., (an, bn) which makes sum of min(ai, bi) for all i from 1 to n as large as poss...

2018-05-28 13:44:53 106

原创 832. Flipping an Image

Given a binary matrix A, we want to flip the image horizontally, then invert it, and return the resulting image.To flip an image horizontally means that each row of the image is reversed.  For example...

2018-05-28 11:36:45 123

原创 387. First Unique Character in a String

Given a string, find the first non-repeating character in it and return it's index. If it doesn't exist, return -1.Examples:s = "leetcode"return 0.s = "loveleetcode",return 2.Note: You may assume...

2018-05-24 14:07:39 127 1

原创 7. Reverse Integer

Given a 32-bit signed integer, reverse digits of an integer.Example 1:Input: 123Output: 321Example 2:Input: -123Output: -321Example 3:Input: 120Output: 21Note:Assume we are dealing with an envir...

2018-05-23 16:22:36 163

原创 344. Reverse String

Write a function that takes a string as input and returns the string reversed.Example:Given s = "hello", return "olleh".func reverseString(s string) string { rs := []rune(s) for i, j := 0, len...

2018-05-23 15:24:46 140

原创 1. Two Sum

Given an array of integers, return indices of the two numbers such that they add up to a specific target.You may assume that each input would have exactly one solution, and you may not use the same el...

2018-05-23 12:01:56 112

原创 283. Move Zeroes

Given an array nums, write a function to move all 0's to the end of it while maintaining the relative order of the non-zero elements.Example:Note:You must do this in-place without making a copy of the...

2018-05-23 00:07:30 119

原创 66. Plus One

Given a non-empty array of digits representing a non-negative integer, plus one to the integer.The digits are stored such that the most significant digit is at the head of the list, and each element i...

2018-05-22 17:21:53 149

原创 350. Intersection of Two Arrays II

Given two arrays, write a function to compute their intersection.Example:Given nums1 = [1, 2, 2, 1], nums2 = [2, 2], return [2, 2].Note:Each element in the result should appear as many times as it sho...

2018-05-22 15:00:06 133

原创 136. Single Number

Given a non-empty array of integers, every element appears twice except for one. Find that single one.Note:Your algorithm should have a linear runtime complexity. Could you implement it without using ...

2018-05-22 12:25:00 101

原创 217. Contains Duplicate

Given an array of integers, find if the array contains any duplicates.Your function should return true if any value appears at least twice in the array, and it should return false if every element is ...

2018-05-22 10:16:26 116

原创 189. Rotate Array

Given an array, rotate the array to the right by k steps, where k is non-negative.Example 1:Input: [1,2,3,4,5,6,7] and k = 3Output: [5,6,7,1,2,3,4]Explanation:rotate 1 steps to the right: [7,1,2,3,...

2018-05-21 17:14:49 116

原创 122. Best Time to Buy and Sell Stock II

Say you have an array for which the ith element is the price of a given stock on day i.Design an algorithm to find the maximum profit. You may complete as many transactions as you like (i.e., buy one ...

2018-05-21 16:59:39 169

原创 26. Remove Duplicates from Sorted Array

Given a sorted array nums, remove the duplicates in-place such that each element appear only once and return the new length.Do not allocate extra space for another array, you must do this by modifying...

2018-05-21 16:41:13 164

原创 C++Primer 第六章 函数

知识点:习题:

2018-05-09 13:59:44 213

原创 C++Primer 第五章 语句

知识点:1.习题:

2018-05-08 16:54:23 159

原创 C++Primer 第四章 表达式

知识点:习题:

2018-05-08 15:20:05 185

原创 C++Primer 第三章 字符串,向量和数组

知识点:1.如果使用等号初始化一个变量,为拷贝初始化(copy initialization),否则为直接初始化(direct initialization)2.string 对字母大小写敏感。3.读取位置数量的string对象:int main { string word; while(cin>>word) cout<<word<<e...

2018-05-07 09:45:26 196

原创 C++Primer 第二章 变量和基本类型

知识点:1.切勿混用带符号类型和无符号类型。2. C++中初始化不是赋值,初始化的含义是创建变量时赋予其一个初始值,而赋值的含义是把对象的当前值擦除,而以一个新值来替代。3.列表初始化(list initialization):C++11中,用花括号初始化变量,当初始值存在丢失信息风险时,编译器将报错。4.默认初始化(default initialization):一些类要求每个对象都显式初始化,...

2018-05-02 14:24:37 168

原创 C++Primer 第一章 开始

知识点:1. main函数的返回类型必须为int。2.  一个注释不能嵌套早另一个注释之内。3. 成员函数(member function)是定义为类的一部分的函数,有时也被称为方法(method)4. 写入操作符(manipulator),结束当前行,并将与设备关联的缓冲区中的内容刷到设备中。缓冲刷新操作可以保证到目前为止程序所产生的所有输出都真正写入输出流中,而不是仅停留再内存中等待写入流。5...

2018-05-02 10:47:48 192

原创 771.Jewels and Stones

You're given strings J representing the types of stones that are jewels, and S representing the stones you have.  Each character in S is a type of stone you have.  You want to know how many of the sto...

2018-04-11 10:00:30 114

原创 RailsGuide学习要点整理(二)

1.在app/views/layouts/application.html.erb中修改网页title

2018-03-06 13:23:17 224

原创 RailsGuide学习要点整理

关于Rails Rails 是使用 Ruby 语言编写的 Web 应用开发框架,目的是通过解决快速开发中的共通问题,简化 Web 应用的开发。与其他编程语言和框架相比,使用 Rails 只需编写更少代码就能实现更多功能。Rails 哲学两大指导思想: ·不要自我重复(DRY): DRY 是软件开发中的一个原则,意思是“系统中的每个功能都要具有单一、准确、可信的实现。”。不重复表述同一件事,写出的代...

2018-03-02 23:48:05 387

转载 MAC OS 快捷键

剪切、拷贝、粘贴和其他常用快捷键Command-X 剪切所选项并将其拷贝到剪贴板。 Command-C 将所选项拷贝到剪贴板。这同样适用于 Finder 中的文件。 Command-V 将剪贴板的内容粘贴到当前文稿或应用中。这同样适用于 Finder 中的文件。 Command-Z 撤销前一个命令。随后您可以按 Command-Shift-Z 来重做,从而反向执行撤销命令。在某些应用中,您可以撤销...

2018-03-01 18:38:29 151

转载 MAC terminal 快捷键

SHORTCUTSKey/CommandDescriptionCtrl + AGo to the beginning of the line you are currently typing on. This also works for most text input fields system wide. Netbeans being one exceptionCtrl + EGo to th...

2018-03-01 18:36:48 637

转载 Safari快捷键

上下方向键 小范围的垂直滚动页面 左右方向键 小范围的水平滚动页面 Option + 方向键 整屏的滚动页面 Cmd + 上下方向键 滚动到页面的最上或最 空格键 整屏滚动 Del 后退 Shift + Del 向前 Page up Page down 整屏滚动 Home 与 End 同 Cmd + 上下方向键 Cmd-Home 转到首页 Esc 如果正在输入地址栏,则返回当前地址 Cmd-点击 ...

2018-03-01 18:24:18 407

Redis从入门到高可用,分布式实践 (完整13章版本)

全13章 第1章 Redis初识 带领听众进入Redis的世界,了解它的前世今生、众多特性、应用场景、安装配置、简单使用,可以让听众对Redis有一个全面的认识。 第2章 API的理解和使用 全面介绍了Redis提供的5种数据结构字符串(string)、哈希(hash)、列表(list)、集合(set)、有序集合(zset)的数据模型、常用命令、典型应用场景。同时本章还会对Redis的单线程处理机制、键值管理做一个全面介绍,通过对这些原理的理解,听众可以在合适的应用场景选择合适的数据结构。 ... 第3章 Redis客户端的使用 本章重点关注Redis客户端的开发,介绍了详细讲解了Java客户端Jedis,简单介绍下Python和Go语言的Redis客户端的选择和使用。 第4章 瑞士军刀Redis其他功能 除了5种数据结构外,Redis还提供了诸如慢查询、Pipeline、Bitmap、HyperLogLog、发布订阅、GEO等附加功能,在这些功能的帮助下,Redis的应用场景更加丰富。 第5章 Redis持久化的取舍和选择 Redis的持久化功能有效避免因进程退出造成的数据丢失问题,本章将介绍介绍RDB和AOF两种持久化配置和运行流程,以及选择策略 第6章 常 见的持久化开发运维问题 本章探讨了常见的持久化问题进行定位和优化,最后结合Redis常见的单机多实例部署场景进行优化 第7章 Redis复制的原理与优化 复制是实现高可用的基石,但复制同样是运维的痛点,本部分详细分析复制的原理,讲解运维过程中可能遇到的问题。 第8章 Redis Sentinel 本章将一步步解析Redis Sentinel的相关概念、安装部署、配置、客户端路由、原理解析,最后分析了Redis Sentinel运维中的一些问题。 第9章 初识Redis Cluster Redis Cluster是Redis 3提供的分布式解决方案,有效解决了Redis分布式方面的需求,同时它也是学习分布式存储的绝佳案例。本章将针对Redis Cluster的数据分布,搭建集群进行分析说明。 第10章 深入Redis Cluster 本章将针对Redis Cluster的集群伸缩,请求路由,故障转移等方面进行分析说明。 第11章 缓存设计与优化 讲解将缓存加入应用架构后带来的一些问题,这些问题常常会成为应用的致命点。 第12章 Redis云平台CacheCloud 本章结合前面的知识介绍redis规模化后使用云平台如何进行机器部署、应用接入、用户相关功能维护等问题 第13章 课程总结

2018-06-22

Python第三方库安装和卸载

详细介绍了第三方的库安装和卸载的方法,方法一:包管理器(推荐) 方法二:源码安装。。。

2018-06-22

空空如也

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

TA关注的人

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