Sly_461的博客

The journey begins!

关于函数(二)数组指针和指针数组

参考http://blog.csdn.net/touch_2011/article/details/69669801、概述 指针数组:指针数组可以说成是”指针的数组”,首先这个变量是一个数组,其次,”指针”修饰这个数组,意思是说这个数组的所有元素都是指针类型,在32位系统中,指针占四个字节。 数组...

2017-07-19 01:42:56

阅读数 268

评论数 1

LeetCode#22* Generate Parentheses

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...

2017-07-18 11:45:10

阅读数 245

评论数 0

关于函数(一)const与函数

一.const与函数1、概述        在普通的非 const成员函数中,this的类型是一个指向类类型的 const指针。可以改变this所指向的值,但不能改变 this所保存的地址。在 const成员函数中,this的类型是一个指向 const类类型对象的 const指针。既不能改变 t...

2017-07-18 11:43:04

阅读数 305

评论数 0

LeetCode#21 Merge Two Sorted Lists

Merge two sorted linked lists and return it as a new list. The new list should be made by splicing together the nodes of the first two lists. 题意:就是给你...

2017-07-17 20:52:02

阅读数 246

评论数 0

LeetCode#20 Valid Parentheses

Given a string containing just the characters ‘(‘, ‘)’, ‘{‘, ‘}’, ‘[’ and ‘]’, determine if the input string is valid.The brackets must close in the ...

2017-07-17 20:47:54

阅读数 241

评论数 0

LeetCode#15* 3Sum && LeetCode#16 3Sum Closest && LeetCode#18 4Sum

【3Sum】 Given an array S of n integers, are there elements a, b, c in S such that a + b + c = 0? Find all unique triplets in the array which gives th...

2017-07-17 20:37:18

阅读数 204

评论数 0

LeetCode#17 Letter Combinations of a Phone Number

Given a digit string, return all possible letter combinations that the number could represent.A mapping of digit to letters (just like on the telepho...

2017-07-17 20:36:53

阅读数 337

评论数 0

LeetCode#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 ...

2017-07-17 20:36:22

阅读数 214

评论数 0

LeetCode#14 Longest Common Prefix

Write a function to find the longest common prefix string amongst an array of strings. 题意:写一个函数(或方法)来寻找一个字符串数组中的最长公共前缀。 例如:”abcdefg”        ”a...

2017-07-17 10:48:01

阅读数 189

评论数 0

LeetCode#12 Integer to Roman && #13* Roman to Integer(罗马数字转换)

12题: Given an integer, convert it to a roman numeral. Input is guaranteed to be within the range from 1 to 3999. 13题: Given a roman numeral, c...

2017-07-17 10:34:18

阅读数 239

评论数 0

LeetCode#11 Container With Most Water

Given n non-negative integers a1, a2, …, an, where each represents a point at coordinate (i, ai). n vertical lines are drawn such that the two endpoi...

2017-07-17 09:59:33

阅读数 324

评论数 0

LeetCode#9* Palindrome Number

Determine whether an integer is a palindrome. Do this without extra space. Some hints: Could negative integers be palindromes? (ie, -1) If yo...

2017-07-17 02:43:12

阅读数 239

评论数 0

LeetCode#8 String to Integer (atoi)

Implement atoi to convert a string to an integer. Hint: Carefully consider all possible input cases. If you want a challenge, please do not see bel...

2017-07-17 02:20:35

阅读数 195

评论数 0

指针和const

一.定义       一般,说到指针和const,就分两种:const指针和指向const的指针。const指针是指针变量的值一经初始化,就不可以改变指向,初始化是必要的;而指向const的指针是说指针指向的变量是const的(其实这种说法也是不太准确的,和const引用有点像)可以这样理解:一种...

2017-07-16 21:13:53

阅读数 345

评论数 0

关于const引用

一.定义       简单地说,const引用是指–指向const的引用(其实这样说不恰当,在我的理解中,const引用中的const只是限定了不能通过此引用去修改变量的值),和const指针一样,const引用可以与常量绑定,也可以与变量绑定,只是不能通过这个const引用来改变绑定对象的值,就...

2017-07-16 01:12:42

阅读数 432

评论数 0

网络层(三)IP协议

IP协议用于将多个包交换网络连接起来,它在源地址和目的地址之间传送一种称之为数据包的东西,它还提供对数据大小的重新组装功能,以适应不同网络对包大小的要求。        IP的责任就是把数据从源传送到目的地。它不负责保证传送可靠性,流控制,包顺序和其它对于主机到主机协议来说很普通的服务。 ...

2017-07-08 17:19:34

阅读数 436

评论数 0

LeetCode#7 Reverse Integer

Reverse digits of an integer. Example1: x = 123, return 321 Example2: x = -123, return -321 click to show spoilers. Note: The input is assum...

2017-07-05 19:18:01

阅读数 173

评论数 0

LeetCode#6 ZigZag Conversion

The string “PAYPALISHIRING” is written in a zigzag pattern on a given number of rows like this: (you may want to display this pattern in a fixed font...

2017-07-05 19:10:19

阅读数 191

评论数 0

LeetCode#5* Longest Palindromic Substring

Given a string s, find the longest palindromic substring in s. You may assume that the maximum length of s is 1000. Example: Input: “babad” O...

2017-07-05 18:23:00

阅读数 251

评论数 0

LeetCode#4* Median of Two Sorted Arrays

There are two sorted arrays nums1 and nums2 of size m and n respectively. Find the median of the two sorted arrays. The overall run time complexity ...

2017-07-05 15:36:44

阅读数 227

评论数 0

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