×î´ó³Ë»ýµÄN 1ÏֻÓó˷¨²»ÄÜÓó˷¨ (Java)ʵÏÖ
package algorithm.misc;
import util.*;
public class MaxProductOfN1 {
private static int exceptIndex = -1;
public static long regMethod(int data[])
{
long ret = Long.MIN_VALUE;
long tmp = 1;
for(int i = 0; i < data.length; i++)
{
tmp = 1;
for(int j = 0; j < data.length; j++)
{
if(j != i)
{
tmp *= data[j];
}
}
if(tmp > ret)
{
ret = tmp;
exceptIndex = i;
}
}
return ret;
}
public static long dp(int data[])
{
long ascent[] = new long[data.length + 1];
ascent[0] = 1;
for(int i = 0; i < data.length; i++)
&nbs
Ïà¹ØÎĵµ£º
java¶àÏß³ÌͨÐÅ ÊÕ²Ø
×ªÔØÇë×¢Ã÷:À´×Ôhttp://blog.csdn.net/M_ChangGong/ ×÷Õß:ÕÅÑà¹ã
java¶àÏß³ÌͨÐÅ£¬Ä£ÄâÉú²úÕß-Ïû·ÑÕß¹ØÏµ¡£
µÚ1ÖÖʵÏÖ£¨¸ÃʵÏÖ´æÔÚÎÊÌ⣩£¬¾ßÌå´úÂëÈçÏ£º
view plaincopy to clipboardprint?
package com.zhangyg.thread.mytest;
/**
* Ä£ÄâÉú²úÕß- ......
JavaºÍÆäËûÓïÑÔ²»Í¬µÄÊÇ£¬JavaÊÇÔËÐÐÓÚJavaÐéÄâ»ú(JVM)¡£Õâ¾ÍÒâζ×űàÒëºóµÄ´úÂëÊÇÒÔ
Ò»ÖÖºÍÆ½Ì¨Î޹صĸñʽ±£´æµÄ£¬¶ø²»ÊÇijÖÖÌØ¶¨µÄ»úÆ÷ÉÏÔËÐеĸñʽ¡£ÕâÖÖ¸ñʽºÍ´«Í³µÄ¿É
Ö´ÐдúÂë¸ñʽÓкܶàÖØÒªµÄÇø±ð¡£¾ßÌåÀ´Ëµ£¬²»Í¬ÓÚC»òÕߣÃ++³ÌÐò£¬Java³ÌÐò²»ÊÇÒ»¸ö¶À
Á¢µÄ¿ÉÖ´ÐÐÎļ ......
JVM£º¼ÓÔØ¡¢Á´½ÓºÍ³õʼ»¯
JVMÒª½âÊÍJava×Ö½ÚÂ룬¾Í±ØÐë¶ÔËùÐèµÄÀàºÍ½Ó¿ÚÖ´ÐÐÈçÏÂ3²½²Ù×÷£º
(1) ¼ÓÔØ£ºJVMÔÚ¼ÓÔØÀàʱ£¬»á²éÕÒ¸ÃÀà»ò¸Ã½Ó¿ÚµÄ¶þ½øÖƱíʾ£¬²¢¸ù¾ÝÕÒµ½µÄ¶þ½øÖƱíʾ(ͨ³£ÊÇÓÉJava±àÒëÆ÷´´½¨µÄÀàÎļþ)´´½¨Ò»¸öClass¶ÔÏ󡣸ÃClass¶ÔÏóÖзâ×°ÁËÀà»ò½Ó¿ÚµÄÔËÐÐʱ״̬¡£
(2) Á´½Ó£ºÁ´½ÓÕâÒ»¹ý³ÌÊÇָȡµÃÒѼÓÔØµÄ ......
Line.javaÎļþ-------Çý¶¯Àà
import javax.swing.JFrame;
public class Line
{
public static void main(String[] arg)
{
JFrame frame=new JFrame("Draw lines");
frame.setDefaultCloseOperation(JFrame.EX ......
Ò» ²åÈëÅÅÐò·¨:
˵Ã÷: ÿ´Î½«Ò»¸ö´ýÅÅÐòµÄ¼Ç¼£¬°´Æä¹Ø¼ü×Ö´óС²åÈëµ½Ç°ÃæÒѾÅźÃÐòµÄ×ÓÎļþÖеÄÊʵ±Î»Öã¬Ö±µ½È«²¿¼Ç¼²åÈëÍê³ÉΪֹ¡£ Java´úÂë public class InsertSorter extends Sorter { /** * from ÆðʼλÖà ......