JeromeHuang

  博客园 :: 首页 :: 博问 :: 闪存 :: 新随笔 :: 联系 :: 订阅 订阅 :: 管理 ::

2015年5月14日

摘要: #1105 : 题外话·堆描述小Ho有一个糖果盒子,每过一段时间小Ho都会将新买来的糖果放进去,同时他也会不断的从其中挑选出最大的糖果出来吃掉,但是寻找最大的糖果不是一件非常简单的事情,所以小Ho希望能够用计算机来他帮忙计算这个问题!最大堆问题。代码如下:#include #include #inc... 阅读全文
posted @ 2015-05-14 21:07 JeromeHuang 阅读(503) 评论(0) 推荐(0) 编辑

2015年5月2日

摘要: RMQ(Range Minimum/Maximum Query),即区间最值查询,是指这样一个问题:对于长度为n的数列A,回答若干询问RMQ(A,i,j)(i,j#include #include #include using namespace std;const int N = 10e6+1... 阅读全文
posted @ 2015-05-02 23:23 JeromeHuang 阅读(718) 评论(0) 推荐(0) 编辑

摘要: 最近研究了一下最近公共祖先算法,根据效率和实现方式不同可以分为基本算法、在线算法和离线算法。下面将结合hihocoder上的题目分别讲解这三种算法。1、基本算法 对于最近公共祖先问题,最容易想到的算法就是从根开始遍历到两个查询的节点,然后记录下这两条路径,两条路径中距离根节点最远的节点就是所要... 阅读全文
posted @ 2015-05-02 23:10 JeromeHuang 阅读(1349) 评论(2) 推荐(0) 编辑

2015年4月25日

摘要: Java文件操作有多种类:文本文件IO、二进制文件IO、随机文件IO、对象序列化IO操作。下面将对每种操作进行介绍:1、文本文件IO Java.io包提供以Wirter和Reader为超类的两组API类进行文本文件IO的处理和操作。 文本文件IO输出类为PrintWriter,提供了具体文本输出... 阅读全文
posted @ 2015-04-25 22:39 JeromeHuang 阅读(224) 评论(0) 推荐(0) 编辑

2015年4月23日

摘要: Givennnon-negative integersa1,a2, ...,an, where each represents a point at coordinate (i,ai).nvertical lines are drawn such that the two endpoints of ... 阅读全文
posted @ 2015-04-23 22:47 JeromeHuang 阅读(121) 评论(0) 推荐(0) 编辑

摘要: 先贴一个使用批处理命令调用神经网络工具箱的方法:P = [0.1515 0.1501 0.1509 0.1504 0.1504 0.1500 0.1515 0.1501 0.1509 0.1504 0.1504 0.1500 0.1... 阅读全文
posted @ 2015-04-23 15:30 JeromeHuang 阅读(10562) 评论(1) 推荐(0) 编辑

2015年4月21日

摘要: Palindrome NumberDetermine whether an integer is a palindrome. Do this without extra space.Some hints:Could negative integers be palindromes? (ie, -1)... 阅读全文
posted @ 2015-04-21 17:54 JeromeHuang 阅读(158) 评论(0) 推荐(0) 编辑

2015年4月20日

摘要: String to Integer (atoi)Implementatoito convert a string to an integer.Hint:Carefully consider all possible input cases. If you want a challenge, plea... 阅读全文
posted @ 2015-04-20 23:08 JeromeHuang 阅读(172) 评论(0) 推荐(0) 编辑

摘要: Reverse IntegerReverse digits of an integer.Example1:x = 123, return 321Example2:x = -123, return -321题目比较简单,注意越界和负数情况即可!Runtime:16 ms#include #includ... 阅读全文
posted @ 2015-04-20 20:32 JeromeHuang 阅读(122) 评论(0) 推荐(0) 编辑

2015年4月19日

摘要: ZigZag ConversionThe string"PAYPALISHIRING"is written in a zigzag pattern on a given number of rows like this: (you may want to display this pattern i... 阅读全文
posted @ 2015-04-19 19:23 JeromeHuang 阅读(153) 评论(0) 推荐(0) 编辑