题目: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 w....
分类:
编程语言 时间:
2014-08-01 06:57:21
阅读次数:
297
#!r6rs
( import ( rnrs base ( 6 ) )
( rnrs io simple ( 6 ) ) )
( define ( deriv exp var )
( define ( variable? x )
( symbol? x ) )
( define ( =number? exp num )...
分类:
其他好文 时间:
2014-08-01 02:28:20
阅读次数:
210
题目还原
Two Sum
Given an array of integers, find two numbers such that they add up to a specific target number.
The function twoSum should return indices of the two numbers such that they add up t...
分类:
其他好文 时间:
2014-08-01 02:25:11
阅读次数:
391
python学习了好久,发现还是个小白,python还是不会用,从今天起每天学写一点小程序,做个打不死的小强。相关知识:列表,字典#!/usr/bin/envpythonpeople={‘yong‘:{‘phone‘:‘123‘,‘addr‘:‘Shanghai‘},‘bu‘:{‘phone‘:‘456‘,‘addr‘:‘Wuhan‘},‘yan‘:{‘phone‘:‘789‘,‘addr‘:‘Henan..
分类:
编程语言 时间:
2014-08-01 00:13:51
阅读次数:
253
Problem Description:
The string "PAYPALISHIRING" is written in a zigzag pattern
on a given number of rows like this: (you may want to display this pattern in a fixed font for better legibility)...
分类:
其他好文 时间:
2014-08-01 00:11:50
阅读次数:
285
第一次实现堆排序,花了近两个小时。
主要还是堆调整,原理网上很多,直接给出运行代码和结果:
代码:
#include
using namespace std;
void adjustHeap(int number[],int k,int length){
int t=number[k];
int i;
for(; k*2+1 < length; k=i){
i=k*2...
分类:
其他好文 时间:
2014-08-01 00:10:20
阅读次数:
285
Minimum Inversion Number
Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others)
Total Submission(s): 10326 Accepted Submission(s): 6359
Problem Description
The invers...
分类:
其他好文 时间:
2014-08-01 00:08:10
阅读次数:
299
给出动态更新数据,实时问第K个大的数值是什么?
利用AVL数据结构做的一个统计数,比较高级的数据结构内容了。
不知道题目给出的数据值是否有重复,因为我下面的程序是可以处理出现数据重复的情况的。
其中的奥妙是增加了repeat的信息,可以知道出现了当前数组多少次。
主要是知道如何维护这些数据和如何查询,维护数据的函数是pushUp,查询函数是selectKth。
其他就是一般的AVL操作。...
分类:
其他好文 时间:
2014-08-01 00:07:00
阅读次数:
273
虽然学习js有一段时间了,但是对js的基础语法却是有些生疏。最近在看jquery源码,决定随带总结一些基础的语法知识。今天总结一下数据类型和typeof,这在写js的时候,是不得不知道的知识。 数据类型: js有5中基本的数据类型:undefined,Null,Boolean,Number,...
分类:
其他好文 时间:
2014-07-31 23:42:10
阅读次数:
231
E -Palindromic NumbersTime Limit:2000MSMemory Limit:32768KB64bit IO Format:%lld & %lluDescriptionA palindromic number or numeral palindrome is a 'symm...
分类:
其他好文 时间:
2014-07-31 23:36:50
阅读次数:
360