自定义博客皮肤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)
  • 收藏
  • 关注

原创 leetcode 62 Unique Paths

A robot is located at the top-left corner of a m x n grid (marked 'Start' in the diagram below).The robot can only move either down or right at any point in time. The robot is trying to reach the bo...

2019-02-24 22:26:04 182

原创 leetcode 206 Reverse Linked List

Reverse a singly linked list.Example:Input: 1->2->3->4->5->NULLOutput: 5->4->3->2->1->NULLFollow up:A linked list can be reversed either iteratively or recursi...

2019-02-22 23:08:25 157

原创 leetcode 230 Kth Smallest Element in a BST

Given a binary search tree, write a function kthSmallest to find the kth smallest element in it.Note: You may assume k is always valid, 1 ≤ k ≤ BST's total elements.Example 1:Input: root = [3,...

2019-02-17 10:36:30 242

转载 【转】git rebase和merge的使用场景及区别

什么是 rebase?git rebase 你其实可以把它理解成是“重新设置基线”,将你的当前分支重新设置开始点。这个时候才能知道你当前分支于你需要比较的分支之间的差异。原理很简单:rebase需要基于一个分支来设置你当前的分支的基线,这基线就是当前分支的开始时间轴向后移动到最新的跟踪分支的最后面,这样你的当前分支就是最新的跟踪分支。这里的操作...

2019-02-16 15:02:52 688

原创 leetcode 94 Binary Tree Inorder Traversal

Given a binary tree, return the inorder traversal of its nodes' values.Example:Input: [1,null,2,3] 1 \ 2 / 3Output: [1,3,2]给定一个二叉树,计算其中序遍历结果。二叉树的遍历一般分为两种,递归遍历和非递归遍历,递归遍历代...

2019-02-16 12:43:14 177

转载 【转】C++ 常见面试题

1. extern关键字的作用     extern置于变量或函数前,用于标示变量或函数的定义在别的文件中,提示编译器遇到此变量和函数时在其他模块中寻找其定义。它只要有两个作用:当它与“C”一起连用的时候,如:extern "C" void fun(int a,int b)...

2019-02-11 22:35:00 186

原创 C++ 单例模式

引言前段时间面试时遇到一个问题,静态变量是否为线程安全的。静态变量在编译时进入main()函数前便进行初始化,其生命周期伴随着整个程序的生命周期,在程序结束时才会释放内存。对于静态实例变量,其在构造的时候是线程安全的,构造过程中第一个线程执行构造,其他线程会阻塞在构造的过程,然后构造完毕后该对象内部的静态变量是非线程安全的,因为其共享的是一份内存。因此,在设计工具类的时候,对于没有使用静态...

2019-02-10 22:51:57 201

原创 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 1:Input: "babad"Output: "bab"Note: "aba" is also a valid answer.Exam...

2019-02-09 13:58:01 161

原创 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 endpoints of line i is at (i, ai) and (i, 0). Find two...

2019-02-09 10:22:58 202

原创 leetcode 2 Add Two Numbers

You are given two non-empty linked lists representing two non-negative integers. The digits are stored in reverse order and each of their nodes contain a single digit. Add the two numbers and return i...

2019-02-09 09:55:32 204

转载 TortoiseGit处理代码冲突

场景一 user0 有新提交user1 没有pull -> 写新代码 -> pull -> 提示有冲突 解决办法一-> stash save(把自己的代码隐藏存起来) -> 重新pull -> stash pop(把存起来的隐藏的代码取回来 ) -> 代码文件会显示冲突 -> 右键选择edit conficts,解决后点...

2019-02-08 21:24:07 430

转载 C++ 虚函数实现机制

转 C++面试题之虚函数(表)实现机制 前言大家都应该知道C++的精髓是虚函数吧? 虚函数带来的好处就是: 可以定义一个基类的指针, 其指向一个继承类, 当通过基类的指针去调用函数时, 可以在运行时决定该调用基类的函数还是继承类的函数. 虚函数是实现多态(动态绑定)/接口函数的基础. 可以说: 没有虚函数, C++将变得一无是处!既...

2019-02-07 19:40:18 2702 4

原创 leetcode 461 Hamming Distance

The Hamming distance between two integers is the number of positions at which the corresponding bits are different.Given two integers x and y, calculate the Hamming distance.Note:0 ≤ x, y < 23...

2019-02-07 10:26:34 209

原创 leetcode 260 Single Number III

Given an array of numbers nums, in which exactly two elements appear only once and all the other elements appear exactly twice. Find the two elements that appear only once.Example:Input: [1,2,1,...

2019-02-06 21:44:08 157

空空如也

空空如也

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

TA关注的人

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