Implement insert and delete in a tri-nary tree. A tri-nary tree is much like a binary tree but with three child nodes for each parent instead of two -...
分类:
其他好文 时间:
2014-10-19 02:40:16
阅读次数:
236
Given a binary tree, return thelevel ordertraversal of its nodes' values. (ie, from left to right, level by level).For example:Given binary tree{3,9,2...
分类:
其他好文 时间:
2014-10-19 01:21:45
阅读次数:
204
1、p或q为None的情况用开始的两个if语句进行判断;2、类中递归调用函数需要使用self进行调用;3、代码很简洁,最后几行通过同时为None和同时非None的条件进行判断; 1 # Definition for a binary tree node 2 # class TreeNode: 3 ....
分类:
编程语言 时间:
2014-10-19 01:17:13
阅读次数:
329
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 le...
分类:
其他好文 时间:
2014-10-18 20:57:37
阅读次数:
229
题目描述:Given two binary strings, return their sum (also a binary string).For example,a ="11"b ="1"Return"100".解题方案: 1 class Solution { 2 public: 3 s...
分类:
其他好文 时间:
2014-10-18 10:56:14
阅读次数:
160
Binary String Matching
时间限制:3000 ms | 内存限制:65535 KB
难度:3
描述Given two strings A and B, whose alphabet consist only ‘0’ and ‘1’. Your task is only to tell how many times does A appear as ...
分类:
编程语言 时间:
2014-10-18 09:50:53
阅读次数:
238
1、二分查找(Binary Search) 二分查找又称折半查找,它是一种效率较高的查找方法。 二分查找要求:线性表是有序表,即表中结点按关键字有序,并且表的存储结构为顺序结构。不妨设有序表是递增有序的。2、二分查找的基本思想二分查找算法思想:(1)首先确定该区间的中点位置: mid = ( l.....
分类:
编程语言 时间:
2014-10-18 01:53:51
阅读次数:
376
Binary String Matching
时间限制:3000 ms | 内存限制:65535 KB
难度:3
描述Given two strings A and B, whose alphabet consist only ‘0’ and ‘1’. Your task is only to tell how many times does A appear as ...
分类:
编程语言 时间:
2014-10-17 23:28:22
阅读次数:
391
Skew Binary斜二进制斜二进制的每位为0, 或 1, 最低位可以为2. 第k位的。。。代表 2k+1 -1,给出一个斜二进制数,把他转换成十进制数。正常模拟就好 1 #include 2 #include 3 char A[1000]; 4 5 int main() { 6 wh...
分类:
编程语言 时间:
2014-10-17 21:48:03
阅读次数:
253
1.AVFoundationBuild Phases => Link Binary With Libraies => + => AVFoundation.framework => addfirstviewcontroller.hC代码 #import#import@interfaceFirstVie...
分类:
移动开发 时间:
2014-10-17 18:19:59
阅读次数:
276