码迷,mamicode.com
首页 >  
搜索关键字:binary trees    ( 12390个结果)
leetcode || 102、Binary Tree Level Order Traversal
problem: Given a binary tree, return the level order traversal of its nodes' values. (ie, from left to right, level by level). For example: Given binary tree {3,9,20,#,#,15,7}, 3...
分类:其他好文   时间:2015-04-20 11:14:41    阅读次数:131
Reverse Bits
Reverse bits of a given 32 bits unsigned integer.For example, given input 43261596 (represented in binary as00000010100101000001111010011100), return ...
分类:其他好文   时间:2015-04-20 11:01:21    阅读次数:128
URAL1965:Pear Trees(DP)
Vova was walking along one of Shenzhen streets when he noticed young pear trees, growing along the pavement. Each tree had a plaque attached to it containing some number. Vova walked around all n tree...
分类:其他好文   时间:2015-04-20 07:01:27    阅读次数:256
【leetcode】Convert Sorted Array to Binary Search Tree
Given an array where elements are sorted in ascending order, convert it to a height balanced BST.采用二分递归。 1 class Solution { 2 public: 3 TreeNode *...
分类:其他好文   时间:2015-04-19 21:10:54    阅读次数:173
【CTF】RE Backdoor CTF 2015 TEAM 600
来源: Backdoor CTF 2015 There is a wierd kind of authentication service running: nc hack.bckdr.in 8004. The binary can be found here. The vampire says t...
分类:其他好文   时间:2015-04-19 15:59:21    阅读次数:194
Maximal Rectangle -- leetcode
Given a 2D binary matrix filled with 0's and 1's, find the largest rectangle containing all ones and return its area. 给定一个充满0和1的矩阵,要求出范围全为1的矩阵的面积。 算法一,动态规划 此题,以每行为底,都可以转换成是一个Largest Rec...
分类:其他好文   时间:2015-04-19 14:45:57    阅读次数:115
Find Peak Element
public class Solution { public int findPeakElement(int[] num) { // binary search http://siddontang.gitbooks.io/leetcode-solution/content/arr...
分类:其他好文   时间:2015-04-19 14:34:05    阅读次数:98
LeetCode (15) Flatten Binary Tree to Linked List
题目描述Given a binary tree, flatten it to a linked list in-place.For example, Given The flattened tree should look like: 本题也是考察二叉树和指针操作的题目。题目要求将一棵二叉树拉平为一个链表 。链表通过树节点的右子树相连,且展开的顺序为原来树的前序遍历。实现思路: 若节点n存...
分类:其他好文   时间:2015-04-18 23:48:59    阅读次数:213
Unique Binary Search Trees II
https://leetcode.com/problems/unique-binary-search-trees-ii/Givenn, generate all structurally uniqueBST's(binary search trees) that store values 1...n...
分类:其他好文   时间:2015-04-18 23:18:39    阅读次数:122
LeetCode (11) 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 000000000...
分类:其他好文   时间:2015-04-18 22:02:38    阅读次数:128
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!