上一页 1 ··· 3 4 5 6 7 8 9 10 11 12 下一页
摘要: stackoverflow: http://stackoverflow.com/questions/1838304/call-the-llvm-jit-from-c-programAnother trial under llvm 3.2;In prepared IR "tst.ll", code:; ModuleID = 'tst.bc' define i32 @add1(i32 %AnArg) { EntryBlock: %0 = add ... 阅读全文
posted @ 2013-06-28 16:33 wlu 阅读(1062) 评论(0) 推荐(0)
摘要: Binary Tree Maximum Path SumGiven a binary tree, find the maximum path sum.The path may start and end at any node in the tree. For example: Given the below binary tree, 1 / \ 2 3Return 6.递归求解。maxPathSum(root)跟maxPathSum(root.left)和maxPathSum(root.right)之间的关系:root左子树的maxPath,右子树的maxP... 阅读全文
posted @ 2013-06-21 23:47 wlu 阅读(2376) 评论(0) 推荐(0)
摘要: LeetCode 跟树结构相关的题目的测试用例中大多是通过String数组来构造树。例如{2,#,3,#,4,#,5,#,6},可以构造出如下的树(将树结构逆时针选择90度显示): 6 5 4 32很直观地可以理解,输入的String数组是对树结构进行“层序”遍历得到的结果。以下代码用于构造树结构,并提供printTree用于打印树结构。package util;import java.util.LinkedList;import java.util.Queue;public class util { public static class TreeNode { int val;... 阅读全文
posted @ 2013-06-18 22:35 wlu 阅读(2802) 评论(0) 推荐(0)
摘要: Path Sum IIGiven a binary tree and a sum, find all root-to-leaf paths where each path's sum equals the given sum.For example: Given the below binary tree and sum = 22, 5 / \ 4 8 / / \ 11 13 4 / \ / \ 7 2 5 1return[... 阅读全文
posted @ 2013-06-18 20:46 wlu 阅读(276) 评论(0) 推荐(0)
摘要: Given a string s, partition s such that every substring of the partition is a palindrome.Return all possible palindrome partitioning of s. For example, given s = "aab",Return [ ["aa","b"], ["a","a","b"] ]求解所有可能的回文划分。分析:p=pp(s[1...n])初始: if 阅读全文
posted @ 2013-05-01 16:56 wlu 阅读(417) 评论(0) 推荐(0)
摘要: Palindrome Partitioning IIMarGiven a string s, partition s such that every substring of the partition is a palindrome.Return the minimum cuts needed for a palindrome partitioning of s. For example, given s = "aab", Return 1 since the palindrome partitioning ["aa","b"] c 阅读全文
posted @ 2013-04-29 12:52 wlu 阅读(461) 评论(0) 推荐(0)
摘要: Dijkstra算法的MapReduce实现 阅读全文
posted @ 2012-12-11 22:24 wlu 阅读(1201) 评论(0) 推荐(0)
摘要: 在hbase客户端htable中批处理操作是通过ExecutorService实现的。ExecutorService类似于线程池,用户提交的put,delete等操作都被响应地创建了线程在ExecutorService中执行,并对各个操作的响应进行返回或异常处理。本文对ExecutorService进行初步介绍,作为hbase客户端代码学习的准备知识。 通常我们会创建一个ExecutorService对象并向其中丢一些线程,然后就任由之执行。例如下面的例子1。package java.ExecutorServiceStudy;import java.util.concurrent.Execut 阅读全文
posted @ 2012-08-10 13:45 wlu 阅读(1356) 评论(0) 推荐(0)
摘要: 引用:http://hi.baidu.com/xuelianglv/blog/item/43adb1103504ef07203f2e0c.html#0在BigTable的论文中讲到了Lease的概念。Least就好比你租房子住,签了多长的合约。如果时间长了,你可以续约(renew)。你也可能因为房子不习惯想换个地住,你就和房东说,取消住房(cancel)。当然在Hbase里,你不用交违约金。因为BigTable会同时处理很多个客户端,就好比是一个有多套房子的房东同时把不同房间租给了多个不同的客户。那它关心什么呢?我想他首先关心的是每个客户的合约(lease)什么时候到期了。在HBase里,也有 阅读全文
posted @ 2012-08-06 21:25 wlu 阅读(2424) 评论(0) 推荐(0)
摘要: This is a object containing several threadpools. Each pool has a name. There is a executorMap of <name, Executor> inside ExecutorService recording the mapping from name to executor , which contains a threadpool. User calls instance.startExecutorService(ExecutorType, maxThreads) to create the E 阅读全文
posted @ 2012-08-06 20:53 wlu 阅读(1549) 评论(1) 推荐(0)
上一页 1 ··· 3 4 5 6 7 8 9 10 11 12 下一页