Ò׽ؽØͼÈí¼þ¡¢µ¥Îļþ¡¢Ãâ°²×°¡¢´¿ÂÌÉ«¡¢½ö160KB

javaʵÏֵĻôÄɹæÔòµÄ¶àÏîʽ¼ÆËã

»ôÄɹæÔò¶àÏîʽ¼ÆËãÈç¹ûʹÓÃÆÓËصĶàÏîʽÇóÖµ£¬Ê±¼ä¸´ÔÓ¶ÈΪO(n*n)£¬¶øÊÇÓÃÁË»ôÄɹæÔò¿ÉÒÔʹÓõݹé»òÕßµü´úÀ´ÊµÏÖ£¬Ê±¼ä¸´ÔÓ¶ÈÊÇO(n),ÏÂÃæÊÇÔ´´úÂë:
/*
* ʵÏÖ»ôÄɹæÔòµÄ¶àÏîʽ¼ÆËãʱ¼ä¸´ÔÓ¶ÈΪO(N)
*/
public class HuonaRule {
public static void main(String args[])
{
double data[]=new double[]{1.0,2,2,3,4};
double x=3;
System.out.println(huonaFunction(data,x,data.length));

}
/*
* dataΪ¶àÏîʽµÄϵÊýÊý×飬xΪֵ£¬nΪϵÊýÊý×éµÄ³¤¶È
* Y=a0+a1*X+a2*X^2+.....+an*X^n;
* Y=a0+X(a1+X(a2+X(a3+X(...))))
*/
public static double huonaFunction(double[] data,double x,int n)
{
double y=0;
int i=n-1;
while( i>=0 )
{
y=x*y+data[i];
i--;
}
return y;
}
}


Ïà¹ØÎĵµ£º

ÔõÑù²é¿´Jsp±àÒëºóÉú³ÉµÄJavaÎļþ

      ¿ÉÄÜ´ó¶àÊýJsp¿ª·¢Ô±ÔÚдÍê³ÌÐò²âÊÔͨ¹ýºó£¬²»Ì«»á¹Ø×¢JspÉú³ÉµÄJavaÎļþ£¬Æäʵ£¬Í¨¹ýJava´úÂ룬¸üÄÜÌåÏÖ³ÌÐò´úÂëµÄÕæÕýº¬Ò壬¶Ô½øÒ»²½Ñо¿³ÌÐò´úÂëµÄºǫ́ÔËÐÐÇé¿öÊǷdz£ÓаïÖúµÄ¡£ÀýÈ磬ÓÃJsp±àд´úÂëʱ£¬ÓÐʱºòÓÃ<%!   %>£¬ÓÐʱºòÓÃ<%   %>£¬¼Ó²»¼Ó¸Ð̾º ......

javaʵÏÖµÄÑ¡ÔñÅÅÐò

ÏÂÃæÊÇÓÃjavaʵÏÖµÄÑ¡ÔñÅÅÐò£¬Ã¿´Î´ÓÊý×éÖÐÑ¡È¡×îСµÄÖµ£º
import java.util.Date;
import java.util.Random;
/*
* Ñ¡ÔñÅÅÐò
*/
public class SelectSort {
public static void main(String args[])
{
int len = 40;
Date date = new Date();
Random random = new Random(date.getSeconds());
int ......

javaʵÏֵĹ鲢ÅÅÐò

Ò»ÏÂÊÇjavaʵÏÖµÄÓÐÒ»¸ö¹é²¢ÅÅÐò£¬×Ô¼º·¢ÏÖ×Ô¼ºµÄ»ù´¡¹¦Ì«²îÁË£¬ËùÒÔ×î½ü¿ªÊ¼Ñ§Ï°Ëã·¨£¬ºÃºÃµÄÁªÏµÃ¿Ò»Ëã·¨£¬¸÷λ´óÉñ²»Òª¼ûЦ£¬Ð´µÄÓдíµÄµØ·½Ï£ÍûÄܹ»Ö¸³öÀ´Ð»Ð»¹þ£º
package sort;
import java.util.Date;
import java.util.Random;
/*
* ¹é²¢ÅÅÐò
*/
public class MergeSort {
public static void main(Stri ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØͼ | ¸ÓICP±¸09004571ºÅ