给出动态更新数据,实时问第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
Maximum Depth of Binary TreeGiven a binary tree, find its maximum depth.The maximum depth is the number of nodes along the longest path from the root ...
分类:
其他好文 时间:
2014-07-31 23:19:10
阅读次数:
259
1安装与配置jdk: 1.6或以上下载MAVEN3.x版本,解压后放在随便一目录,然后在系统环境变量配置MAVEN路径。运行cmd-->输入 mvn -version 会出现maven版本信息。此处有机会出错,如显示JAVA_HOME问题,请配置JAVA_HOME即jdk路径,然后在path中比ma...
分类:
其他好文 时间:
2014-07-31 23:14:40
阅读次数:
231
eclipse 中,tomcat 6.0 不支持 web module 3.0 Tomcat version 6.0 only supports J2EE 1.2, 1.3, 1.4, and Java EE 5 Web modules ?在 eclipse 中,使用 Tomcat 6.0 的时候,不支持?Dynamic Web Module?3.0...
分类:
Web程序 时间:
2014-07-31 21:25:27
阅读次数:
626
maven?引入 <dependency>
??<groupId>org.hibernate</groupId>
??<artifactId>hibernate-validator</artifactId>
??<version>4.0.1.GA</version>
</dependency>
<dependency>
??<groupId>ja...
分类:
编程语言 时间:
2014-07-31 21:23:47
阅读次数:
323
/*
2^x mod n = 1
Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others)
Total Submission(s): 11800 Accepted Submission(s): 3673
Problem Description
Give a number n...
分类:
其他好文 时间:
2014-07-31 20:58:04
阅读次数:
171
Problem Description:
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...
分类:
其他好文 时间:
2014-07-31 20:48:17
阅读次数:
215
今天遇到了一个很恶心的问题。。。htc某些机器的menu键是在屏幕里的,可以由系统控制显示和隐藏。今天遇到了一个问题,有两个应用,一个运行后显示menu键,另一个不显示。。。找了好一会儿,发现是android:targetSdkVersion="18"的问题最终sdk build version 1...
分类:
移动开发 时间:
2014-07-31 20:29:37
阅读次数:
231