`
phantom
  • 浏览: 160033 次
社区版块
存档分类
最新评论
文章列表
转自http://zyfromcq.iteye.com/blog/1233471 0/1背包问题的动态规划法求解,前人之述备矣,这里所做的工作,不过是自己根据理解实现了一遍,主要目的还是锻炼思维和编程能力,同时,也是为了增进对动态规划法机制的理解和掌握。       值得提及的一个问题是,在用 JAVA 实现时, 是按算法模型建模,还是用对象模型建模呢? 如果用算法模型,那么 背包的值、重量就直接存入二个数组里;如果用对象模型,则要对背包以及背包问题进行对象建模。思来想去,还是采用了对象模型,尽管心里感觉算法模型似乎更好一些。有时确实就是这样,对象模型虽然现在很主流,但也不是万能的,采用其它 ...
/* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Versi ...
/** * IK Analyzer Demo * @param args */ import java.io.File; import java.io.IOException; import java.io.StringReader; import java.util.List; import org.apache.lucene.document.Document; import org.apache.lucene.document.Field; import org.apache.lucene.index.IndexWriter; impor ...
写道 import java.io.BufferedInputStream; import java.io.File; import java.io.FileInputStream; import java.io.FileOutputStream; import java.io.IOException; import java.io.OutputStreamWriter; import java.net.HttpURLConnection; import java.net.URL; import java.util.Date; public class WGet { public static ...
public class Util { public static void main(String args[]){ System.out.println(toInRowName("userName").equals("USER_NAME")); System.out.println(toOntRowName("GROUP_USER_NAME").equals("groupUserName")); } public static String toOntRowName(String v ...
javaVMEditor功能 在以php168模板模型的系统上制作专题、主页模板时可以快速切割页面代码,并生成相应文件入库。一旦自动入库的数据和要制作的页面的模板对应好,就可在cms上主页、专题管理中不用录入任何数据就可以预览 ...
<?php class acmeCache{ function fetch($name, $refreshSeconds = 0){ if(!$GLOBALS['cache_active']) return false; if(!$refreshSeconds) $refreshSeconds = 60; $cacheFile = acmeCache::cachePath($name); if(file_exists($cacheFile) and ((time()-filemtime($cacheFile))< $refreshSeconds)) ...
import java.io.BufferedReader; import java.io.BufferedWriter; import java.io.File; import java.io.FileInputStream; import java.io.FileOutputStream; import java.io.IOException; import java.io.InputStream; import java.io.InputStreamReader; import java.io.OutputStream; import java.io.OutputStreamWriter; ...

38

...

38

...
...
...
...
...
java 代码 package org.jh.app.count;       import java.util.ArrayList;    import java.util.Collections;    import java.util.List;    import java.util.Set;       import org.apache.commons.collections.Bag;    import org.apache.commons.collections.BagUtils;    imp ...
Global site tag (gtag.js) - Google Analytics