Algorithms
文章平均质量分 74
aherine
无无
展开
-
求Maximum Depth of Binary Tree 广度优先遍历算法
#include#include#include#include#define ElemType charusing namespace std;typedef struct BiTNode{ ElemType data; struct BiTNode *lchild,*rchild;}BiTNode,*BiTree;void CreateBiTree(BiTree &T){原创 2017-03-01 21:16:25 · 282 阅读 · 0 评论 -
Single Number 3
Description:Given an array of numbers nums, in which exactly two elements appear only once and all the other elements appear exactly twice. Find the two elements that appear only once.For exampl转载 2017-02-21 22:47:25 · 274 阅读 · 0 评论 -
Single Number 2
Description:Given an array of integers, every element appears three times except for one, which appears exactly once. Find that single one.Note:Your algorithm should have a linear runtime complexity. ...原创 2017-02-21 22:51:54 · 196 阅读 · 0 评论 -
Reverse Bits
Description:Reverse bits of a given 32 bits unsigned integer.For example, given input 43261596 (represented in binary as 00000010100101000001111010011100), return 964176192 (represented in binary原创 2017-02-22 15:43:11 · 324 阅读 · 0 评论