資源簡介
Java寫的Gps,是一個作業,功能比較齊全………………

代碼片段和文件信息
public?class?Chain?
{????
public?ChainNode?first;
public?Chain(){first=null;}
public?void?Delete(int?k)//刪除元素
{
try
{
if(k<1||first==null)
throw?new?Exception(“Exception:BadInput7“);
ChainNode?p=first;
if(k==1)
first=first.link;
else
{
ChainNode?q=first;
for(int?index=1;index q=q.link;
if(q==null||q.link==null)
throw?new?Exception();
p=q.link;
q.link=p.link;
}
}
catch(Exception?e)
{
System.out.println(“please?rewrite9“);
}
}
public?int?search(int?elem)//查詢元素
{
ChainNode?current=first;
int?index=1;
while(current!=null&¤t.data!=elem){
current=current.link;
index++;
}
if(current!=null)?return?index;
return?0;
}
public?void?Insert(int?kint?x)//插入元素
{
try
{
if(k<0)throw?new?Exception(“Exception:BadInput11“);
ChainNode?p=first;
for(int?index=1;index p=p.link;
if(k>0&&p==null)throw?new?Exception(“Exception:BadInput12“);
ChainNode?y=new?ChainNode();
y.data=x;
if(k!=0)
{
y.link=p.link;
p.link=y;
}
else{
y.link=first;
first=y;
}
}
catch(Exception?e)
{
System.out.println(e.getMessage());
System.out.println(“please?rewrite13“);
}
} ?
public?boolean?IsEmpty()//判斷鏈表是否為空
{
return?first==null;
}
}
?屬性????????????大小?????日期????時間???名稱
-----------?---------??----------?-----??----
?????文件????????226??2009-02-27?17:35??GPS\GPS\.classpath
?????文件????????380??2009-02-27?17:35??GPS\GPS\.project
?????文件???????1657??2009-03-04?12:45??GPS\GPS\Chain.class
?????文件???????1394??2009-02-27?17:40??GPS\GPS\Chain.java
?????文件????????658??2009-03-04?12:45??GPS\GPS\ChainIterator.class
?????文件????????349??2009-02-27?17:40??GPS\GPS\ChainIterator.java
?????文件????????286??2009-03-04?12:45??GPS\GPS\ChainNode.class
?????文件?????????84??2009-02-27?17:40??GPS\GPS\ChainNode.java
?????文件???????5413??2009-03-04?12:45??GPS\GPS\EditANewMap.class
?????文件???????5771??2009-02-28?00:41??GPS\GPS\EditANewMap.java
?????文件???????5927??2009-03-04?12:45??GPS\GPS\EditExistedMap.class
?????文件???????6203??2009-02-27?17:40??GPS\GPS\EditExistedMap.java
?????文件???????1971??2009-03-04?12:45??GPS\GPS\FindShortestPath.class
?????文件???????1929??2009-02-27?17:53??GPS\GPS\FindShortestPath.java
?????文件???????2409??2009-03-04?12:45??GPS\GPS\GetMapInformation.class
?????文件???????2186??2009-02-27?17:40??GPS\GPS\GetMapInformation.java
?????文件????????773??2009-03-04?12:45??GPS\GPS\ImportMapfr
?????文件????????773??2009-03-04?12:45??GPS\GPS\ImportMapfr
?????文件????????965??2009-03-04?12:45??GPS\GPS\ImportMapfr
?????文件???????4979??2009-03-04?12:45??GPS\GPS\ImportMapfr
?????文件???????5539??2009-02-27?17:40??GPS\GPS\ImportMapfr
?????文件???????8057??2009-03-04?12:45??GPS\GPS\Mainfr
?????文件???????7338??2009-02-27?18:02??GPS\GPS\Mainfr
?????文件??????33368??2009-02-28?00:55??GPS\GPS.jar
?????目錄??????????0??2009-10-13?21:16??GPS\GPS
?????目錄??????????0??2009-10-13?21:16??GPS
-----------?---------??----------?-----??----
????????????????98635????????????????????26
- 上一篇:Java Web條件查詢含源碼
- 下一篇:63k的移動QQ——經測試過能用
評論
共有 條評論