- 博客(18)
- 资源 (6)
- 收藏
- 关注
原创 LeetCode 297. Serialize and Deserialize Binary Tree
BFS# Definition for a binary tree node.# class TreeNode(object):# def __init__(self, x):# self.val = x# self.left = None# self.right = None"""首刷"""class Code...
2018-08-20 23:36:33
191
原创 LeetCode 382. Linked List Random Node
蓄水池算法# Definition for singly-linked list.# class ListNode(object):# def __init__(self, x):# self.val = x# self.next = Noneclass Solution(object): def __init__(self, h...
2018-08-20 23:07:57
175
原创 LeetCode 43. Multiply Strings
"""大数相乘1.开空间 2.逆序3.对位相乘4.处理进位5.处理前导06.逆序转化为答案"""class Solution(object): def multiply(self, num1, num2): """ :type num1: str :type num2: str :rtype: str...
2018-08-20 22:50:05
177
原创 LeetCode 328. Odd Even Linked List
解法1# Definition for singly-linked list.# class ListNode(object):# def __init__(self, x):# self.val = x# self.next = None"""首刷O(n)时间复杂度顺序不能变分开2条链难点:停止条件是什么?"""class...
2018-08-16 11:26:05
169
原创 LeetCode 312. Burst Balloons
Given n balloons, indexed from 0 to n-1. Each balloon is painted with a number on it represented by array nums. You are asked to burst all the balloons. If the you burst balloon i you will get nums[le...
2018-08-09 00:05:48
152
原创 LeetCode 87. Scramble String
Given a string s1, we may represent it as a binary tree by partitioning it to two non-empty substrings recursively.Below is one possible representation of s1 = "great": great / \ gr ...
2018-08-04 00:03:02
215
原创 LeetCode 877. Stone Game
Alex and Lee play a game with piles of stones. There are an even number of piles arranged in a row, and each pile has a positive integer number of stones piles[i].The objective of the game is to en...
2018-08-02 20:19:57
647
原创 LintCode 395. Coins in a Line II
395. Coins in a Line IIThere are n coins with different value in a line. Two players take turns to take one or two coins from left side until there are no more coins left. The player who take the co...
2018-08-02 19:32:08
319
原创 LintCode 394. Coins in a Line
DescriptionThere are n coins in a line. Two players take turns to take one or two coins from right side until there are no more coins left. The player who take the last coin wins.Could you please ...
2018-08-02 16:50:40
325
原创 LeetCode 329. Longest Increasing Path in a Matrix
Given an integer matrix, find the length of the longest increasing path.From each cell, you can either move to four directions: left, right, up or down. You may NOT move diagonally or move outside o...
2018-08-02 15:55:30
145
原创 Xgboost4j打包 java Ubuntu安装
Xgboost4j打包 java Ubuntu安装1. 踩过的坑写在最前网上找了几个教程,教程比较少,能用上的不多(1)比如jni.h 和 jni_md.h 用来编译xgboost4j_wrapper.cpp生成打包的动态链接库 (只存在旧版本,但是还是以java文件夹名,现在是jvm-packages),没生成成功 (2)去网上找了个别人的动态链接库libxgboostjavawrapper.
2017-09-20 19:54:29
1804
1
翻译 Elasticsearch+Mongodb+nutch
0.环境:Ubuntu14.04ES 1.4.4Mongodb 2.7.6Nutch 2.31.参考链接:http://www.aossama.com/search-engine-with-apache-nutch-mongodb-and-elasticsearch/
2016-01-12 17:46:04
912
原创 Elasticsearch+Mongodb 用mongo-connector 实时更新
0.说明:(1)单机用mongo-connector连接ES和Mongo,ES也支持作为后端数据库,当为了保持业务逻辑.用Mongo作为后端数据库,利用mongo-connector. 将mongo的数据导入到ES中(2)原来想用nucth作为连接ES和Mongo,没有成功.指定nutch的gora配置,用nucth形成index的时候(nutch index -all),出现问题.(
2016-01-12 16:17:52
3595
原创 Lucene 5.3 自定义同义词分词器
Code 1:MySameWordTokenFilterpublic class MySameWordTokenFilter extends TokenFilter{ private CharTermAttribute cta = null;//自定义流的属性 private PositionIncrementAttribute pia = nu
2015-10-13 20:22:51
770
原创 Lucene 5.3 使用Lucene自定义StopAnalyzer
一、不包含原来分词器StopAnalyZer信息Code 1:public class MyStopAnalyzer extends Analyzer { //一组数组产生分词对象 private CharArraySet stopWordsSet;//自己要屏蔽的一些单词 //构造函数 public My
2015-10-12 10:23:42
955
原创 Lucene错误_解决方案
(1)java.lang.NoSuchFieldError: CONSTANT_SCORE_REWRITE at org.apache.lucene.queryparser.classic.QueryParserBase.(QueryParserBase.java:68) at org.apache.lucene.queryparser.classic.QueryParser.
2015-10-05 20:08:29
1411
原创 Lucene-学习笔记 (版本3,5VS 5.3)
Lucene5.3 与Lucene3.5 的一些区别(1)Lucene3.5 Document.setBoost //对文档设置权值 Lucene5.3: 只有Field.setBoost //对域设置权值(2)3.5 有IndexReader.undeleteALL() //将一些逻辑删除的索引复原 5.3
2015-10-05 19:48:23
1011
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人