自定义博客皮肤VIP专享

*博客头图:

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

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

博客底图:

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

栏目图:

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

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

-+
  • 博客(18)
  • 收藏
  • 关注

原创 Leetcode刷题记录——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:...

2018-09-24 18:21:40 168

原创 Leetcode刷题记录——812. Largest Triangle Area

题目 You have a list of points in the plane. Return the area of the largest triangle that can be formed by any 3 of the points.Example:Input: points = [[0,0],[0,1],[1,0],[0,2],[2,0]]Output: 2...

2018-09-24 17:16:03 152

原创 Leetcode刷题记录——598. Range Addition II

题目 Given an m * n matrix M initialized with all 0's and several update operations.Operations are represented by a 2D array, and each operation is represented by an array with two positive integ...

2018-09-23 22:37:57 133

原创 Leetcode刷题记录——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 t...

2018-09-23 18:36:19 126

原创 Leetcode刷题记录——867. Transpose Matrix

题目 Given a matrix A, return the transpose of A.The transpose of a matrix is the matrix flipped over it's main diagonal, switching the row and column indices of the matrix. Example 1:Inpu...

2018-09-23 14:02:03 133

原创 Leetcode刷题记录——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.  F...

2018-09-23 00:41:25 233

原创 Leetcode刷题记录——590. N-ary Tree Postorder Traversal

题目 Given an n-ary tree, return the postorder traversal of its nodes' values. For example, given a 3-ary tree:Return its postorder traversal as: [5,6,3,2,4,1].  题目大意&解题思路 这道题的意思...

2018-09-22 11:19:25 159

原创 Leetcode刷题记录——700. Search in a Binary Search Tree

题目 Given the root node of a binary search tree (BST) and a value. You need to find the node in the BST that the node's value equals the given value. Return the subtree rooted with that node. If s...

2018-09-21 21:03:05 622

原创 Leetcode刷题记录——202. Happy Number

题目 Write an algorithm to determine if a number is "happy".A happy number is a number defined by the following process: Starting with any positive integer, replace the number by the sum of the s...

2018-09-21 16:15:37 154

原创 Leetcode刷题记录——905. Sort Array By Parity

题目https://leetcode.com/problems/sort-array-by-parity/description/ 题目大意是给你一个数组,将偶数排在奇数前面,返回数组。解题思路 最简单的思路是依次遍历,每当碰到一个奇数,就从之后的数组元素中找出一个偶数,进行遍历,如果找不到,说明该元素之后的元素全是奇数,那么可以直接返回数组,如果找到,则进行交换,然后再遍历下一个元...

2018-09-21 10:44:07 215

原创 数据结构-——哈希表C++

定义百度百科显示哈希表的定义是:散列表(Hash table,也叫哈希表),是根据关键码值(Key value)而直接进行访问的数据结构。也就是说,它通过把关键码值映射到表中一个位置来访问记录,以加快查找的速度。这个映射函数叫做散列函数,存放记录的数组叫做散列表。那么将关键码值映射到表中的一个位置,这种方法是什么呢?给定表M,存在函数f(key),对任意给定的关键字值key,代...

2018-09-16 11:43:54 1600

原创 Effective C++读书笔记(三)关于const关键字

待更新

2018-06-02 16:37:08 102

原创 数据结构——栈(c语言)

1 栈的概念栈(stack)是限定仅在表尾进行插入和删除操作的线性表。 栈的特点是:后进先出。2 栈的API 操作 说明 InitiStack( *s ) 建立一个空栈,并进行初始化操作 DestroyStack 若栈存在,则销毁它 ClearStack 将栈清空 StackEmpty 若栈为空,返回true,否则返回false Push 若栈存在,插

2017-08-09 19:13:53 449

原创 C语言程序内存分配中的堆和栈

1. C/C++编译的程序占用的内存1. 1 可以看出,此可执行程序在存储时(没有调入到内存)分为代码区(text)、数据区(data)和未初始化数据区(bss)3个部分。(1)代码区(text segment) 放CPU执行的机器指令(machine instructions)。 (2)全局初始化数据区/静态数据区(initialized data segment/data segment)

2017-07-28 17:55:09 2766 4

原创 数据结构——单链表

1. 相关概念1. 1 单链表定义单链表是线性表链式存储的一种,其储存不连续。单链表的数据结构中包含两个变量:结点数据data和指向下一结点的指针next。一个结点只知道下一个结点的地址。 注:一个单链表必须有一个头指针,指向单链表中的第一个结点。否则链表会在内存中丢失。1. 2 关于头指针链表中第一个结点的存储位置叫做头指针,那么整个链表的存取就必须是从头指针开始进行了。之后的每一个结点,其实就

2017-07-23 21:14:55 502

原创 C语言字符串那些事儿

1. 字符串基础知识1.1 什么是字符串字符串就是一串零个或多个字符,并且以一个位模式为全0的NUL字节结尾。其中NUL是人为定义用作字符串结尾的标志,所以字符串的长度不包括NUL字节。 NUL字节其实就是ASCII码为0的数。 例:char *line = "world0";则在gdb调试发现:(gdb)x/7d line0x8048470 119 111 114 108 1

2017-07-18 11:21:11 726

原创 变量的声明、定义、extern、static总结

1. 变量的声明和定义变量定义: 所谓定义就是编译器创建一个对象,并且为变量分配一块存储空间,并给它取上一个名字,这个名字就是我们经常所说的变量名或对象名。在程序中对象有且仅有一个定义。例如int a 在声明的时候已经建立了存储空间。变量声明:声明有两重含义:第一重含义:告诉编译器,这个名字已经匹配到一块内存上了,下面的代表用到该变量或对象是在别的地方定义的,声明可以出现多次。第二重含义:告

2017-07-13 22:06:50 1401 1

转载 欢迎使用CSDN-markdown编辑器

欢迎使用Markdown编辑器写博客本Markdown编辑器使用StackEdit修改而来,用它写博客,将会带来全新的体验哦:Markdown和扩展Markdown简洁的语法代码块高亮图片链接和图片上传LaTex数学公式UML序列图和流程图离线写博客导入导出Markdown文件丰富的快捷键快捷键加粗 Ctrl + B 斜体 Ctrl + I 引用 Ctrl

2017-07-13 13:48:41 160

空空如也

空空如也

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

TA关注的人

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