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

ÓÃJAVAʵÏÖ¶ÑÕ»£¨Êý×éƪ£©

ʲôÊǶÑÕ»£¬¹ØÓÚÕâ¸öÃû´Ê£¬ÎÒÔڰٶȣ¬googleËÑË÷ÁË°ëÌ죬ҲûÓз¢ÏÖÒ»¸ö±È½ÏȨÍþµÄ½âÊÍ£¬»¹ÓÐÐí¶à×ÊÁÏÓïÑɲ»Ï꣬¾ÍÒÔά»ù°Ù¿ÆµÄ½âÊÍΪ׼°É£¬ºÍÎÒ¼ÇÒäÖеÄÒ»Ö¡£
¶ÑÕ»£¨Ó¢ÎÄ£ºstack£©£¬Öйú´ó½×÷¶ÑÕ»£¬Ì¨Íå×÷¶Ñµþ£¬ÔÚ¼ÆËã»ú¿Æ學ÖУ¬ÊÇÒ»種ÌØÊâµÄ´®ÁÐÐÎʽµÄ資ÁÏ結構£¬ËüµÄÌØÊâÖ®處ÔÚì¶Ö»ÄÜÔÊ許ÔÚ鏈結´®Áлò陣ÁеÄÒ»¶Ë£¨稱為¶Ñ疊頂¶ËÖ¸標£¬Ó¢ÎÄ為top£©進ÐмÓÈë資ÁÏ£¨push£©ºÍ輸³ö資ÁÏ£¨pop£©µÄ運Ëã¡£ÁíÍâ¶Ñ疊Ò²¿ÉÒÔÓÃÒ»維陣Áлò連結´®ÁеÄÐÎʽ來Íê³É¡£¶Ñ疊µÄÁíÍâÒ»個Ïà對µÄ²Ù×÷·½Ê½稱為佇ÁС£
ÓÉ춶Ñ疊資ÁÏ結構Ö»ÔÊ許ÔÚÒ»¶Ë進ÐвÙ×÷£¬Òò¶ø°´ÕÕáá進Ïȳö£¨LIFO, Last In First Out£©µÄÔ­Àí運×÷¡£
¶Ñ疊資ÁÏ結構ʹÓÃ兩種»ù±¾²Ù×÷£ºÍÆÈ루push£©ºÍ彈³ö£¨pop£©£º
ÍÆÈ루push£© £º將數據·ÅÈë¶Ñ疊µÄ頂¶Ë£¨陣ÁÐÐÎʽ»ò´®ÁÐÐÎʽ£©£¬¶Ñ疊頂¶ËtopÖ¸標¼ÓÒ»¡£
彈³ö£¨pop£©  £º將頂¶Ë數據資ÁÏ輸³ö£¨»Ø傳£©£¬¶Ñ疊頂¶Ë資ÁÏ減Ò»¡£
ÏÂÃæÊÇÓÃjavaÊý×éʵÏÖ¶ÑÕ»
/**
* ʹÓÃÊý×éʵÏÖ¶ÑÕ»£¬°üÀ¨ÈëÕ»¡¢³öÕ»¡¢»ñÈ¡¶ÑÕ»³¤¶È¡¢
* @author Adair
*/
public class Stack {

Object[] data;

int maxSize;
//Õ»¶¥Î»ÖÃ
int top;

public Stack(int maxSize) {
this.maxSize = maxSize;
data = new Object[maxSize];
top = -1;
}

/**
* »ñÈ¡¶ÑÕ»³¤¶È
* @return ¶ÑÕ»³¤¶È
*/
public int getSize()
{
return maxSize;
}

/**
* ·µ»ØÕ»ÖÐÔªËصĸöÊý
* @return Õ»ÖÐÔªËصĸöÊý
*/
public int getElementCount()
{
return top;
}

/**
* ÅжÏÕ»¿Õ
* @return Õ»¿Õ
*/
public boolean isEmpty()
{
return top == -1;
}

/**
* ÅжÏÕ»Âú
* @return Õ»Âú
*/
public boolean isFull()
{
return top+1


Ïà¹ØÎĵµ£º

JavaÀà¼ÓÔØ»úÖÆ


Àà¼ÓÔØÊÇJava³ÌÐòÔËÐеĵÚÒ»²½£¬Ñо¿ÀàµÄ¼ÓÔØÓÐÖúÓÚÁ˽âJVMÖ´Ðйý³Ì£¬²¢Ö¸µ¼¿ª·¢Õß²ÉÈ¡¸üÓÐЧµÄ´ëÊ©ÅäºÏ³ÌÐòÖ´ÐС£
Ñо¿Àà¼ÓÔØ»úÖƵĵڶþ¸öÄ¿µÄÊÇÈóÌÐòÄܶ¯Ì¬µÄ¿ØÖÆÀà¼ÓÔØ£¬±ÈÈçÈȲ¿ÊðµÈ£¬Ìá¸ß³ÌÐòµÄÁé»îÐÔºÍÊÊÓ¦ÐÔ¡£
Ò»¡¢¼òµ¥¹ý³Ì
Java³ÌÐòÔËÐеij¡ËùÊÇÄڴ棬µ±ÔÚÃüÁîÐÐÏÂÖ´ÐУº
java HelloWorld
ÃüÁîµÄʱºò£¬JVM» ......

JavaỊ̈߳º²¢·¢Ð­×÷ Éú²úÕßÏû·ÑÕßÄ£ÐÍ

¶ÔÓÚ¶àÏ̳߳ÌÐòÀ´Ëµ£¬²»¹ÜÈκαà³ÌÓïÑÔ£¬Éú²úÕߺÍÏû·ÑÕßÄ£ÐͶ¼ÊÇ×î¾­µäµÄ¡£¾ÍÏñѧϰÿһÃűà³ÌÓïÑÔÒ»Ñù£¬Hello World!¶¼ÊÇ×î¾­µäµÄÀý×Ó¡£
¡¡¡¡Êµ¼ÊÉÏ£¬×¼È·ËµÓ¦¸ÃÊÇ“Éú²úÕß-Ïû·ÑÕß-²Ö´¢”Ä£ÐÍ£¬À뿪Á˲ִ¢£¬Éú²úÕßÏû·ÑÕßÄ£Ð;ÍÏÔµÃûÓÐ˵·þÁ¦ÁË¡£
¡¡¡¡¶ÔÓÚ´ËÄ£ÐÍ£¬Ó¦¸ÃÃ÷ȷһϼ¸µã£º
¡¡¡¡1¡¢Éú²úÕß½ö½öÔÚ²Ö´ ......

ajax ·¢ËÍxmlÎļþ£¬java½ÓÊÜxmlÎļþ²¢½âÎö

ºìÉ«×ÖÌåΪÖ÷Òª´úÂë
jspÒ³ÃæÖÐ
<script language="javascript">
function  updateDB(operate){
  var objDom=new ActiveXObject("msxml.DomDocument");
   var objRoot=objDom.createElement("All");
   objDom.appendChild(objRoot);
  
  var k=document.ge ......

±£»¤ÄãµÄJAVA / .net ³ÌÐò,ÖÕ¼«±ÜÃâ±»·´±àÒë·½·¨Ñо¿

±£»¤ÄãµÄJAVA / .net ³ÌÐò,ÖÕ¼«±ÜÃâ±»·´±àÒë·½·¨Ñо¿
·´±àÒëÕæµÄÈÃJAVA / .net ÖÆ×÷ÕßÌÖÑáµÄ¶«Î÷¡£Ä㻨´óÁ¿µÄ¾«Á¦×öÁËÒ»¸öºÜºÃµÄÈí¼þ£¬È´ÓÐÈ˵ÁÓã¬
µÁÓö¼ËãÁË
È˼һ¹ÓÃÀ´ÉÌÒµ...
¾ÍÏñijÎÄ˵µÄ.ÄãµÄÈí¼þÂò XXXXXXXX´óÔª.È˼ҹ«Ë¾Âò200Ôª.....
Ôõô×öµ½ÄØ£¿¾ÍÊÇͨ¹ý·´±àÒë¡£
ÎÒÃÇ¿ÉÒÔ¿´µ½
¾ÍËã±£»¤ºÜÇ¿µÄreflector4/ ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØͼ | ¸ÓICP±¸09004571ºÅ