Daily Archives: September 20, 2012

brute force to solve the subarry max sum issue

public void findAllSubMatrix( int[][] arr ){    int row = arr.length;    int col = arr[0].length;     int maxSum = 0;     // below 2 loop to loop row pair    for( int i = 0; i < row; i++ )    {        for( … Continue reading

Posted in Uncategorized | Leave a comment

merge array range

public class Node implements Comparator{    public int value;    public boolean isStart;     public Node( int value,  int isStart )    {        this.value = value;        this isStart = isStart;    }     public int compare( Object o1 , Object o2 )    {        Node … Continue reading

Posted in Uncategorized | Leave a comment

some post links

http://www.mitbbs.com/article_t/JobHunting/32031811.html   http://www.mitbbs.com/article_t/JobHunting/32030585.html     http://www.mitbbs.com/article_t/JobHunting/32033497.html     http://www.mitbbs.com/article_t/JobHunting/32032215.html   http://www.mitbbs.com/article_t/JobHunting/32032611.html

Posted in Uncategorized | Leave a comment

another good forum about algorithm

http://www.1point3acres.com/bbs/forum-84-1.html

Posted in Uncategorized | Leave a comment

merge range

http://1point3acres.com/bbs/thread-15148-1-1.html   一个range的序列,如[1,3], [2,6], [8,10],[15,18] : 写程序合并有重叠的range,比如上面的序列合并为[1,6], [8,10], [15,18] 我觉得可以只对起点排序。 然后依次扫描。设当前合并段的起点为s, 终点为e。下一个要比较的段,起点为i,终点j: if(i <= e){ if(j > e) e = j; //合并下一段,延长终点。 }else{ //保存当前s,e,然后开始一个新的合并段 i = s; e = j; } void PrintMerge2(int a[], int n) { assert(a && n … Continue reading

Posted in Uncategorized | Leave a comment

a very good algorithm blog

http://haixiaoyang.wordpress.com/category/intervalsegment/

Posted in Uncategorized | Tagged | Leave a comment

Word

Terminal Transcript @ Sep 19, 2012 9:57:02 PM terminal++@10.0.0.2:~$ ls bin lib programming projects sdcard sum.java system tmp terminal++@10.0.0.2:~$ cd programming/ terminal++@10.0.0.2:~/programming$ ls 8Queens aandb matrixRotate90Deg replaceSpace vpnConnection.sh Book Solutions hello recursive trie terminal++@10.0.0.2:~/programming$ cd re recursive/ replaceSpace/ terminal++@10.0.0.2:~/programming$ cd … Continue reading

Posted in Uncategorized | Leave a comment