自定义博客皮肤VIP专享

*博客头图:

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

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

博客底图:

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

栏目图:

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

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

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

转载 macos生成SSH key与GitHub连接

一、检查 SSH key 是否存在在终端输入:ls -al ~/.ssh如果没有,终端显示如下:No such file or directory如果已经存在,则会显示 id_rsa 和 id_rsa.pub二、生成新的 SSH key在终端输入:ssh-keygen -t rsa -C "your_email@example.com"其中 your_email@example.com 为你在 G...

2018-03-22 22:26:06 567

原创 单独的数字(线性时间复杂度,且无额外空间)

给定一个数组 A,除了一个数出现一次之外,其余数都出现三次。找出出现一次的数。如:{1, 2, 1, 2, 1, 2, 7},找出 7。难点:算法只能是线性时间的复杂度,并且不能使用额外的空间。策略:采用位运算,把每个数字的每一位都加起来,对3取余。(同理,其余数出现k次,就对k取余)本机int型变量是32位,故外层循环为32位(常数级循环),内层n重循环,因此符合线性时间复杂度。#include...

2018-03-02 18:45:46 469

原创 Given n points on a 2D plane, find the maximum number of points that lie on the same straight line.

题目:Given n points on a 2D plane, find the maximum number of points that lie on the same straight line.(给的点是用vector保存)/** * Definition for a point. * struct Point { * int x; * int y; * ...

2018-02-19 12:13:44 496

原创 二叉树层次输出带换行

1. 二叉树的层次输出(不带换行输出)思想:利用一个队列void levelPrint1(BTree *root){ //不带换行的 if(!root)return; BTree *temp; queue myque; myque.push(root); while(!myque.empty()){ temp = myque.front(); print(temp->va

2018-01-30 17:14:46 1517

空空如也

空空如也

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

TA关注的人

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