自定义博客皮肤VIP专享

*博客头图:

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

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

博客底图:

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

栏目图:

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

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

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

原创 1064. Complete Binary Search Tree

A Binary Search Tree (BST) is recursively defined as a binary tree which has the following properties: The left subtree of a node contains only nodes with keys less than the node's key. The righ

2017-08-08 09:39:04 263

原创 1008. Elevator (20)

The highest building in our city has only one elevator. A request list is made up with N positive numbers. The numbers denote at which floors the elevator will stop, in specified order. It costs 6 sec

2017-07-31 20:05:25 197

原创 dynamic_cast 运算符

今天从头开始读代码,发现 dynamic_cast  。例如B C D 。B是基类,C D 依次继承上层,则可以有 class B { }; class C : public B { }; class D : public C { }; void f(D* pd) { C* pc = dynamic_cast(pd); // ok: C is a direct

2017-07-31 14:37:09 179

原创 剑指Offer——二叉树的镜像

操作给定的二叉树,将其变换为源二叉树的镜像。 输入描述:二叉树的镜像定义:源二叉树 8 / \ 6 10 / \ / \ 5 7 9 11 镜像二叉树 8 / \ 10 6 / \ / \ 11 9 7 5 /*struc

2017-07-05 21:24:56 157

原创 389. Find the Difference

Given two strings s and t which consist of only lowercase letters. String t is generated by random shuffling string s and then add one more letter at a random position. Find the letter that was

2017-04-25 00:18:22 223

原创 136. Single Number

Given an array of integers, every element appears twice except for one. Find that single one. Note: Your algorithm should have a linear runtime complexity. Could you implement it without using ext

2017-04-24 23:28:53 125

原创 476. Number Complement

Given a positive integer, output its complement number. The complement strategy is to flip the bits of its binary representation. Note: The given integer is guaranteed to fit within the range of

2017-04-21 16:37:03 146

原创 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,

2017-04-20 20:05:47 141

原创 递归

#include int getPeachNumber(int n) { int num; //定义所剩桃子数 if(n==10) { return 1; //递归结束条件 } else { num = (getPeachNumber(n+1)+1)*2; //这里是不应该用递归呢?

2017-04-14 20:10:24 222

原创 基础练习BASIC-8-回文数

问题描述   1221是一个非常特殊的数,它从左边读和从右边读是一样的,编程求所有这样的四位十进制数。 (第一个自己独立做出来的) 输出格式   按从小到大的顺序输出满足条件的四位十进制数。 public class Main{ public static void main(String[] args) { int sum; for(sum=1000;sum i

2017-03-11 20:25:20 141

空空如也

空空如也

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

TA关注的人

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