Given two binary strings, return their sum (also a binary string).For example,a ="11"b ="1"Return"100".博主对于自己那冗长的代码真是累感不爱了~连注释都不用标了,特别清晰明了,捂脸逃走~只能安慰自己...
分类:
其他好文 时间:
2015-04-13 06:51:00
阅读次数:
107
https://leetcode.com/problems/reverse-bits/
Reverse bits of a given 32 bits unsigned integer.
For example, given input 43261596 (represented in binary as 00000010100101000001111010011100), ret...
分类:
其他好文 时间:
2015-04-13 00:26:40
阅读次数:
143
Description:Given two binary trees, write a function to check if they are equal or not. Two binary trees are considered equal if they are structurall....
分类:
其他好文 时间:
2015-04-13 00:17:28
阅读次数:
130
题目Write a function that takes an unsigned integer and returns the number of ’1’ bits it has (also known as the Hamming weight).For example, the 32-bit integer ’11’ has binary representation 00000000000...
分类:
其他好文 时间:
2015-04-12 21:12:01
阅读次数:
130
Given a binary tree, flatten it to a linked list in-place.For example,Given 1 / \ 2 5 / \ \ 3 4 6The flattened t...
分类:
其他好文 时间:
2015-04-12 20:56:55
阅读次数:
122
Given an array where elements are sorted in ascending order, convert it to a height balanced BST./** * Definition for binary tree * public class TreeN...
分类:
其他好文 时间:
2015-04-12 20:38:48
阅读次数:
159
好久不写了,最近忙毕业论文呢。这个题,就是说一个二叉树,你从右边看,你能看到的数有哪些(会被遮挡)其实抽象出来就是说。。。二叉树每层最右边的数有哪些。。那我们按层遍历一次就好了。/** * Definition for binary tree * struct TreeNode { * in...
分类:
其他好文 时间:
2015-04-12 20:37:02
阅读次数:
110
题目:An inorder binary tree traversal can be implemented in a non-recursive way with a stack. For example, suppose that when a 6-node binary tree (with ...
分类:
其他好文 时间:
2015-04-12 16:06:42
阅读次数:
107
一:LeetCode 105 Construct
Binary Tree from Preorder and Inorder Traversal
题目:
Given preorder and inorder traversal of a tree, construct the binary tree.
Note:
You may assume that duplicates d...
分类:
其他好文 时间:
2015-04-12 14:50:20
阅读次数:
117