自定义博客皮肤VIP专享

*博客头图:

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

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

博客底图:

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

栏目图:

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

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

-+

syyyy712的博客

格局决定未来!

  • 博客(7)
  • 收藏
  • 关注

原创 Leetcode 46. Permutations 和Leetcode 47. Permutations II

本文中这两题全排列的解法采用了STL中的函数next_permutation(),其返回值是布尔类型,next_permutation()函数是寻找当前排列之后的下一个排列,比如[1,2,3]后面的是[1,3,2],当找到[3,2,1]时发现没有下一个排列就会返回false。另外还有一个函数是prev_permutation(),该函数是寻找当前排列的前一个排列,比如当前排列是[1,3,2],那么...

2018-07-23 09:36:37 179

原创 Leetcode34. Find First and Last Position of Element in Sorted Array

描述: 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). I...

2018-07-14 14:30:03 456

原创 leetcode. 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. k is a positive integer and is less than or equal to the length of the linked list. If the numbe...

2018-07-13 11:13:48 143

原创 leetcode. 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 mo...

2018-07-13 10:33:16 111

原创 Valid Palindrome II

描述 Given a non-empty string s, you may delete at most one character. Judge whether you can make it a palindrome. The string will only contain lowercase characters a-z. The maximum length of the stri...

2018-07-11 11:10:41 145

转载 C++ STL 之 unordered_set 介绍

简介 C++ 11中出现了两种新的关联容器:unordered_set和unordered_map,其内部实现与set和map大有不同,set和map内部实现是基于RB-Tree,而unordered_set和unordered_map内部实现是基于哈希表(hashtable),由于unordered_set和unordered_map内部实现的公共接口大致相同,所以本文以unordered_s...

2018-07-11 09:49:33 10404

翻译 KMP算法

KMP算法是字符串匹配算法,主要有两步组成: step1:简历PrefixTable,求出小于本身的最长公共前后缀; step2 :根据PrefixTable进行KMP搜索; C++代码: #include<iostream> using namespace std; //创建前缀表 void PrefixTable(char pattern[], int prefi...

2018-07-01 13:04:48 205

空空如也

空空如也

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

TA关注的人

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