A simple 1D searching problem. Binary search of course.But.. STL has already done it for you:class Solution {public: int searchInsert(int A[], int ...
分类:
其他好文 时间:
2014-07-18 18:35:41
阅读次数:
205
Given a binary tree and a sum, determine if the tree has a root-to-leaf path such that adding up all the values along the path equals the given sum.Fo...
分类:
其他好文 时间:
2014-07-18 18:28:44
阅读次数:
231
题目:应用递归,将输入的二进制数转换为十进制。#include #include void binary_to_decimal(char *s, long dec){ if( *s == '\0' ) printf("Decimal: %ld\n",dec); else ...
分类:
其他好文 时间:
2014-07-18 18:23:50
阅读次数:
217
在注册表中,“键值项数据”可分为下面三种类型。字符串值(REG_SZ) 该值一般用来作为文件描述和硬件标志,可以是字母、数字,也可以是汉字,但它是长度固定的文本字符串,最大长度不能超过255个字符。REG文件中一般表现为:"a"="****"。 二进制值(REG_BINARY) 一般情况下,大多数硬...
分类:
其他好文 时间:
2014-07-18 15:39:40
阅读次数:
280
# find -type f -name "*.c" | xargs grep ""是你要找的文件夹;如果是当前文件夹可以省略-type f 说明,只找文件-name "*.c" 表示只找C语言写的代码,从而避免去查binary;也可以不写,表示找所有文件是你要找的某个字符串sudo find .....
分类:
系统相关 时间:
2014-07-18 15:29:57
阅读次数:
258
/bin----bin是Binary的缩写。这个目录存放着最经常使用的命令。/boot----这里存放的是启动Linux时使用的一些核心文件,包括一些链接文件以及镜像文件。/dev----dev是Device(设备)的缩写。该目录下存放的是Linux的外部设备,在Linux中访问设备的方式和访问文件的方式是相同的。/..
分类:
系统相关 时间:
2014-07-18 13:09:31
阅读次数:
254
Dropping BallsA number of K balls are dropped one by one from the root of a fully binary tree structure FBT. Each time the ball being dropped first v....
分类:
其他好文 时间:
2014-07-18 12:14:24
阅读次数:
202
Given a binary tree containing digits from 0-9 only,
each root-to-leaf path could represent a number.
An example is the root-to-leaf path 1->2->3 which represents
the number 123.
Find the to...
分类:
其他好文 时间:
2014-07-18 11:13:57
阅读次数:
204
Given a binary tree, determine if it is height-balanced.For this problem, a height-balanced binary tree is defined as a binary tree in which the depth...
分类:
其他好文 时间:
2014-07-18 09:33:38
阅读次数:
194
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-07-17 23:27:12
阅读次数:
216