码迷,mamicode.com
首页 >  
搜索关键字:binary trees    ( 12390个结果)
Construct Binary Tree from Inorder and Postorder Traversal
题目 Given inorder and postorder traversal of a tree, construct the binary tree. Note: You may assume that duplicates do not exist in the tree. 方法 依据树的中 ...
分类:其他好文   时间:2017-07-02 12:26:46    阅读次数:244
LeetCode 104. Maximum Depth of Binary Tree (二叉树的最大深度)
Given a binary tree, find its maximum depth. The maximum depth is the number of nodes along the longest path from the root node down to the farthest l ...
分类:其他好文   时间:2017-07-02 10:24:30    阅读次数:111
LeetCode 101. Symmetric Tree (对称树)
Given a binary tree, check whether it is a mirror of itself (ie, symmetric around its center). For example, this binary tree [1,2,2,3,4,4,3] is symmet ...
分类:其他好文   时间:2017-07-02 10:07:03    阅读次数:251
C语言 读写二进制文件
查找了比较多的资源,发现没有办法把text文件转成binary文件仅作为记录,不过这个例子可以去除换行符。#include<stdio.h> #include<string.h> #defineN255 intmain() { chara[N]; FILE*fp1,*fp2; fp1=fopen("test_seq.fa","r"); fp2=fopen("testSeq.dat","wb"); ..
分类:编程语言   时间:2017-07-02 00:08:15    阅读次数:200
LeetCode 100. Same Tree (相同的树)
Given two binary trees, write a function to check if they are equal or not. Two binary trees are considered equal if they are structurally identical a ...
分类:其他好文   时间:2017-07-01 22:35:51    阅读次数:204
leetcode || 50、Pow(x, n)
problem: Implement pow(x, n). Hide Tags Math Binary Search 题意:求x的n次幂 </form> thinking: (1)最简单想到的是直观上的数学幂函数求法,測试通过。算法时间复杂度为O(n) (2)依照标签提示,使用二分搜索法。pow(x ...
分类:其他好文   时间:2017-07-01 20:05:21    阅读次数:133
EularProject 36:2进制和10进制回文数
华电北风吹 天津大学认知计算与应用重点实验室 完毕日期:2015/7/29 Double-base palindromes Problem 36 The decimal number, 585 = 10010010012 (binary), is palindromic in both bases. ...
分类:其他好文   时间:2017-07-01 15:25:35    阅读次数:134
Codeforces Round #420 B
Okabe and Banana Trees 题意:给一个y=b-x/m 在这条直线与x y正半轴围成的三角形里,找一个矩形,使得矩形内所有的点(包括矩形边缘)的权值和最大,每个点的权值为横坐标与纵坐标之和 思路:暴力枚举x= 0--m*b, 计算答案,取最大值,注意爆int,计算y值的时候去尾取整 ...
分类:其他好文   时间:2017-07-01 12:45:32    阅读次数:155
392. Is Subsequence
https://leetcode.com/problems/is-subsequence/#/solutions http://www.cnblogs.com/EdwardLiu/p/6116896.html Follow Up: The best solution is to create a m ...
分类:其他好文   时间:2017-07-01 12:43:29    阅读次数:116
LeetCode 563. Binary Tree Tilt (二叉树的倾斜度)
Given a binary tree, return the tilt of the whole tree. The tilt of a tree node is defined as the absolute difference between the sum of all left subt ...
分类:其他好文   时间:2017-07-01 10:00:56    阅读次数:239
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!