码迷,mamicode.com
首页 >  
搜索关键字:binary trees    ( 12390个结果)
Add Binary
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
LeetCode—Reverse Bits ,1 Bit和数字的二进制情况相关
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
LeetCode - Same Tree
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
[LeetCode]191.Number of 1 Bits
题目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
Flatten Binary Tree to Linked List *
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
Convert Sorted Array to Binary Search Tree
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
[leetcode]Binary Tree Right Side View
好久不写了,最近忙毕业论文呢。这个题,就是说一个二叉树,你从右边看,你能看到的数有哪些(会被遮挡)其实抽象出来就是说。。。二叉树每层最右边的数有哪些。。那我们按层遍历一次就好了。/** * Definition for binary tree * struct TreeNode { * in...
分类:其他好文   时间:2015-04-12 20:37:02    阅读次数:110
PAT006 Tree Traversals Again
题目: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/106 Construct Binary Tree from Preorder/Postorder and Inorder Traversal
一: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
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!