自定义博客皮肤VIP专享

*博客头图:

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

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

博客底图:

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

栏目图:

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

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

-+

北海的博客

心若北海-以容鲲鹏

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

原创 67. Add Binary

Given two binary strings, return their sum (also a binary string).For example,a = "11"b = "1"Return "100".简单方法,依次相加,若一个string加完还有进一,则对接下来的继续加class Solution {public: string addBina

2016-08-29 14:29:39 337

原创 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.简单思路:两层遍历。class Solution {public: int firstUniqChar(string s) { int

2016-08-25 21:15:16 178

原创 14. Longest Common Prefix

Write a function to find the longest common prefix string amongst an array of strings.简单思路,先获得第一个字串,比较个字串,比较后的结果作为下次比较的输入。class Solution {public: string longestCommonPrefix(vector& strs) {

2016-08-25 20:37:18 253

原创 OpenSSL-SSL协议

一、OpenSSL简介OpenSSL是一个基于密码学的安全开发包,整个软件包大概可以分成三个主要的功能部分:SSL协议库、应用程序以及密码算法库。OpenSSL的目录结构自然也是围绕这三个功能部分进行规划的。OpenSSL提供的功能相当强大和全面,囊括了主要的密码算法、常用的密钥和证书封装管理功能以及SSL协议,并提供了丰富的应用程序供测试或其它目的使用。其核心是对SSL协议的实现。二

2016-08-25 16:56:24 1484

原创 190. Reverse Bits

Reverse bits of a given 32 bits unsigned integer.For example, given input 43261596 (represented in binary as 00000010100101000001111010011100), return 964176192 (represented in binary as 001110010

2016-08-25 12:49:23 287

原创 203. Remove Linked List Elements

Remove all elements from a linked list of integers that have value val.ExampleGiven: 1 --> 2 --> 6 --> 3 --> 4 --> 5 --> 6, val = 6Return: 1 --> 2 --> 3 --> 4 --> 5思路比较简单,直接遍历,删除就可以了。对于第一个

2016-08-25 11:33:41 218

原创 234. Palindrome Linked List

Given a singly linked list, determine if it is a palindrome.简单的使用栈,检测是否回文/** * Definition for singly-linked list. * struct ListNode { *     int val; *     ListNode *next; *     ListNode(

2016-08-24 17:18:28 182

原创 58. Length of Last Word

Given a string s consists of upper/lower-case alphabets and empty space characters ' ', return the length of last word in the string.If the last word does not exist, return 0.Note: A word is

2016-08-24 10:36:51 177

原创 38. Count and Say

The count-and-say sequence is the sequence of integers beginning as follows:1, 11, 21, 1211, 111221, ...1 is read off as "one 1" or 11.11 is read off as "two 1s" or 21.21 is read off as 

2016-08-24 10:02:41 173

原创 20. Valid Parentheses

Given a string containing just the characters '(', ')', '{', '}', '[' and ']', determine if the input string is valid.The brackets must close in the correct order, "()" and "()[]{}" are all va

2016-08-23 21:04:10 157

原创 290. Word Pattern

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.

2016-08-23 19:16:28 177

原创 19. Remove Nth Node From End of List

Given a linked list, remove the nth node from the end of list and return its head.For example, Given linked list: 1->2->3->4->5, and n = 2. After removing the second node from the end, the

2016-08-22 12:49:59 167

原创 88. Merge Sorted Array

Given two sorted integer arrays nums1 and nums2, merge nums2 into nums1 as one sorted array.Note:You may assume that nums1 has enough space (size that is greater or equal to m + n) to hold addit

2016-08-22 11:46:59 288

原创 获取图片颜色相同的最大块,获取二维数组中值上下左右连续相同的最大块

问题:查找一块图片中区域颜色相同的最大的一块,以二维数组模拟图片,共有1、2、3、4四种颜色。输入:一个二维数组,每个值为1、2、3、4中的一个。输出:最大块颜色值及最大块总数值。主要思路:参数设置:int a[10][10],作为被查找最大块的原始数据,数组里用1、2、3、4表示4种不同的颜色。为方便验证正确性,此处使用10*10的二位数组。int k,记录当前颜色。

2016-08-21 11:09:24 2467

空空如也

空空如也

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

TA关注的人

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