herrDeng網內搜尋

自訂搜尋

Ads

2012年10月22日 星期一

LinkedList Exercise

輸入字串陣列a[0],a[1],...a[4]

利用Java Class LinkedList 作初一鏈結串列:

[ a[0], a[1], a[2], a[4], a[4],a[3],a[2],a[0] ]

Hint:可利用方法addFirst, add, remove.....

54 則留言:

B10033022梁朝富 提到...

import java.util.*;
public class link {
public static void main(String[] args) {
String a[]={"a[4]","a[3]","a[2]","a[1]","a[0]"};
LinkedList<String> aa=new LinkedList<String>();
for (int i=0; i<a.length;i++)
aa.add(a[i]);
aa.remove(3);
for (int i=0; i<a.length;i++)
aa.addFirst(a[i]);
aa.remove(3);
System.out.print(aa);
}
}

B10033045林仲仁 提到...


import java.util.*;

public class hello {
public static void main(String[] args){
String a[]={"a[4]","a[3]","a[2]","a[1]","a[0]"};
LinkedList<String> aa = new LinkedList<String>();
for (int i=0;i<a.length;i++)
aa.addFirst(a[i]);
aa.remove(3);
for(int i=0;i<a.length;i++)
aa.add(a[i]);
System.out.println(aa);




}

}

b10033016許竣翔 提到...

import java.util.*;
public class hello {

public static void main(String[] args) {
String a[]={"a[4]","a[3]","a[2]","a[1]","a[0]"};
LinkedList aa=new LinkedList();
for (int i=0; i<a.length ; i++)
aa.addFirst(a[i]);
aa.remove(3);
for (int i=0; i<a.length ;i++)
aa.add(a[i]);
System.out.println(aa);
// TODO Auto-generated method stub

}

}

b10033005徐維焱 提到...

package P1;
import java.util.*;
public class HW1 {
public static void main(String[] args) {
String a[]={"a[4]","a[3]","a[2]","a[1]","a[0]"};
LinkedList<String> aa=new LinkedList<String>();
for (int i=0; i<a.length; i++)
aa.addFirst(a[i]);
aa.remove(3);
for (int i=0; i<a.length ;i++)
aa.add(a[i]);
aa.remove(7);
System.out.println(aa);

}

}

B10033003鍾明修 提到...

package p3;
import java.util.*;
public class hw3
{
public static void main(String[]args)
{
String a[]={"a[4]","a[3]","a[2]","a[1]","a[0]"};
LinkedList<String> aa=new LinkedList<String>();
for(int i=0;i<a.length;i++)
aa.addFirst(a[i]);
aa.remove(3);
for(int i=0;i<a.length;i++)
aa.add(a[i]);
aa.remove(7);
System.out.println(aa);
}
}

b10033039 提到...

import java.util.*;
public class hello {
public static void main (String[] args){
String a[]={"a[4]","a[3]","a[2]","a[1]","a[0]"};
LinkedList<String> aa=new LinkedList<String>();
for (int i=0; i<a.length; i++)
aa.addFirst(a[i]);
aa.remove(3);
for (int i=0; i<a.length ;i++)
aa.add(a[i]);
System.out.println(aa);
}
}

B9833035 提到...

import java.util.*;
public class B9833035 {
public static void main(String[] args) {
String a[]={"a[4]","a[3]","a[2]","a[1]","a[0]"};
LinkedList<String> aa=new LinkedList<String>();
for (int i=0; i<a.length; i++)
aa.addFirst(a[i]);
aa.remove(3);
for (int i=0; i<a.length ;i++)
aa.add(a[i]);
System.out.println(aa);

}

}

B10033015蕭任淵 提到...


import java.util.*;
public class hello {
public static void main(String[] args) {
String a[]={"a[4]","a[3]","a[2]","a[1]","a[0]"};
LinkedList<String> aa=new LinkedList<String>();
for (int i=0; i<a.length; i++)
aa.addFirst(a[i]);
aa.remove(3);
for (int i=0; i<a.length ;i++)
aa.add(a[i]);
aa.remove(7);
System.out.println(aa);

}

}

B10033019 提到...

import java.util.*;
public class link {
public static void main(String[] args) {
String a[] = {"a[4]","a[3]","a[2]","a[1]","a[0]"};
LinkedList<String> aa = new LinkedList<String>();
for (int i=0; i<a.length; i++)
aa.addFirst(a[i]);
for (int i=0; i<a.length; i++)
aa.add(a[i]);
System.out.println(aa);

}

}

B10033044 提到...


import java.util.*;
public class B10033044 {
public static void main(String[] args) {
String a[]={"a[4]","a[3]","a[2]","a[1]","a[0]"};
LinkedList<String> aa=new LinkedList<String>();
for (int i=0; i<a.length; i++)
aa.addFirst(a[i]);
aa.remove(3);
for (int i=0; i<a.length ;i++)
aa.add(a[i]);
System.out.println(aa);

}

}

B10033057李長勳 提到...


import java.util.*;
public class b10033057 {

public static void main(String[] args) {
String a[]={"a[4]","a[3]","a[2]","a[1]","a[0]"};
LinkedList<String> aa=new LinkedList<String>();
for (int i=0;i<a.length;i++)
aa.addFirst(a[i]);
aa.remove(3);
for (int i=0;i<a.length;i++)
aa.add(a[i]);
aa.remove(7);
System.out.println(aa);
}

}

B10033037徐瑜駿 提到...

import java.util.*;
public class NI {
public static void main(String[] args){
String a[]={"ZERO","ONE","TWO","THREE","FOUR"};
LinkedList aa=new LinkedList();
for (int i=0; i<a.length; i++)
aa.addFirst(a[i]);
aa.remove(3);
for (int i=0; i<a.length ;i++)
aa.add(a[i]);
System.out.println(aa);
}
}

B10033002卓孟杰 提到...

import java.util.*;
public class jas {

public static void main(String[] args) {
String a[]={"a[4]","a[3]","a[2]","a[1]","a[0]"};
LinkedList aa=new LinkedList();
for (int i=0; i<a.length ; i++)
aa.addFirst(a[i]);
aa.remove(3);
for (int i=0; i<a.length ;i++)
aa.add(a[i]);
System.out.println(aa);
// TODO Auto-generated method stub
}
}

b10033042林藝兆 提到...

import java.util.*;
public class hello {
public static void main(String[] args) {
String a[]={"a[4]","a[3]","a[2]","a[1]","a[0]"};
LinkedList aa=new LinkedList();
for (int i=0; i<a.length ; i++)
aa.addFirst(a[i]);
aa.remove(3);
for (int i=0; i<a.length ;i++)
aa.add(a[i]);
System.out.println(aa);
// TODO Auto-generated method stub
}
}


B9813129 林峻葦 提到...

import java.util.*;
public class List {

public static void main (String[] args) {
String a[]={"FOUR","THREE","ONE","ZERO"};
LinkedList aa=new LinkedList{};
for(int i=0;i<a.length;i++)
aa.add(a[i]);
aa.remove(3);
for(int i=0;i<a.length;i++)
aa.addFirst(a[i]);
aa.remove(3);
Sytsem.out.println(aa);
}
}

B10033004 羅時侒 提到...

import java.util.*;
public class hello {

public static void main(String[] args) {
String a[]={"a[4]","a[3]","a[2]","a[1]","a[0]"};
LinkedList aa=new LinkedList();
for (int i=0; i<a.length ; i++)
aa.addFirst(a[i]);
aa.remove(3);
for (int i=0; i<a.length ;i++)
aa.add(a[i]);
System.out.println(aa);
// TODO Auto-generated method stub

}

}

B10033056 陳信吉 提到...

import java.util.*;
public class hello {

public static void main(String[] args) {
String a[]={"a[4]","a[3]","a[2]","a[1]","a[0]"};
LinkedList aa=new LinkedList();
for (int i=0; i<a.length ; i++)
aa.addFirst(a[i]);
aa.remove(3);
for (int i=0; i<a.length ;i++)
aa.add(a[i]);
System.out.println(aa);
// TODO Auto-generated method stub

}

}

B101033050張恩慈 提到...

import java.util.*;
public class hello {

public static void main(String[] args) {
String a[]={"a[4]","a[3]","a[2]","a[1]","a[0]"};
LinkedList aa=new LinkedList();
for (int i=0; i<a.length ; i++)
aa.addFirst(a[i]);
aa.remove(3);
for (int i=0; i<a.length ;i++)
aa.add(a[i]);
System.out.println(aa);
// TODO Auto-generated method stub

}

}

B10033035陳雅婷 提到...

import java.util.*;
public class hello {

public static void main(String[] args) {
String a[]={"a[4]","a[3]","a[2]","a[1]","a[0]"};
LinkedList aa=new LinkedList();
for (int i=0; i<a.length ; i++)
aa.addFirst(a[i]);
aa.remove(3);
for (int i=0; i<a.length ;i++)
aa.add(a[i]);
System.out.println(aa);
// TODO Auto-generated method stub

}

}

b10033014鄧宇純 提到...

import java.util.*;
public class link {
public static void main(String[] args) {
String a[]={"a[4]","a[3]","a[2]","a[1]","a[0]"};
LinkedList<String> aa=new LinkedList<String>();
for (int i=0; i<a.length;i++)
aa.add(a[i]);
aa.remove(3);
for (int i=0; i<a.length;i++)
aa.addFirst(a[i]);
aa.remove(3);
System.out.print(aa);
}
}

b10033021簡良宇 提到...

import java.util.*;
public class link {
public static void main(String[] args) {
String a[]={"a[4]","a[3]","a[2]","a[1]","a[0]"};
LinkedList<String> aa=new LinkedList<String>();
for (int i=0; i<a.length;i++)
aa.add(a[i]);
aa.remove(3);
for (int i=0; i<a.length;i++)
aa.addFirst(a[i]);
aa.remove(3);
System.out.print(aa);
}
}

B10033050張恩慈 提到...

import java.util.*;
public class hello {

public static void main(String[] args) {
String a[]={"a[4]","a[3]","a[2]","a[1]","a[0]"};
LinkedList aa=new LinkedList();
for (int i=0; i<a.length ; i++)
aa.addFirst(a[i]);
aa.remove(3);
for (int i=0; i<a.length ;i++)
aa.add(a[i]);
System.out.println(aa);
// TODO Auto-generated method stub

}

}

B10033052劉悅旻 提到...

import java.util.*;
public class hallo {
public static void main(String[] args) {
String a[]={"a[4]","a[3]","a[2]","a[1]","a[0]"};
LinkedList<String> aa=new LinkedList<String>();
for (int i=0; i<a.length;i++)
aa.add(a[i]);
aa.remove(3);
for (int i=0; i<a.length;i++)
aa.addFirst(a[i]);
aa.remove(3);
System.out.print(aa);
}
}

B10033027黃盈嘉 提到...

import java.util.*;
public class hallo {
public static void main(String[] args) {
String a[]={"a[4]","a[3]","a[2]","a[1]","a[0]"};
LinkedList<String> aa=new LinkedList<String>();
for (int i=0; i<a.length;i++)
aa.add(a[i]);
aa.remove(3);
for (int i=0; i<a.length;i++)
aa.addFirst(a[i]);
aa.remove(3);
System.out.print(aa);
}
}

B10033046徐紹桓 提到...

import java.util.*;
public class hello {
public static void main(String[] args) {
String a[]={"a[4]","a[3]","a[2]","a[1]","a[0]"};
LinkedList aa=new LinkedList();
for (int i=0; i<a.length ; i++)
aa.addFirst(a[i]);
aa.remove(3);
for (int i=0; i<a.length ;i++)
aa.add(a[i]);
System.out.println(aa);
// TODO Auto-generated method stub
}
}

B9833091陳孟偉 提到...

import java.util.*;
public class NYPD
{

public static void main(String[] args)
{
String a[]={"a[4]","a[3]","a[2]","a[1]","a[0]"};
LinkedList aa=new LinkedList();
for (int i=0;i<a.length;i++)
aa.addFirst(a[i]);
aa.remove(3);
for (int i=0;i<a.length;i++)
aa.add(a[i]);
aa.remove(7);
System.out.println(aa);
}

}

B10033011邵怡青 提到...

import java.util.*;
public class shao {

public static void main(String[] args) {
String a[]={"a[4]","a[3]","a[2]","a[1]","a[0]"};
LinkedList aa=new LinkedList();
for (int i=0; i<a.length ; i++)
aa.addFirst(a[i]);
aa.remove(3);
for (int i=0; i<a.length ;i++)
aa.add(a[i]);
System.out.println(aa);
// TODO Auto-generated method stub

}

}

B10033020 提到...

import java.util.*;
public class hello {
public static void main(String[] args) {
String a[]={"a[4]","a[3]","a[2]","a[1]","a[0]"};
LinkedList<String> aa=new LinkedList<String>();
for (int i=0; i<a.length;i++)
aa.add(a[i]);
aa.remove(3);
for (int i=0; i<a.length;i++)
aa.addFirst(a[i]);
aa.remove(3);
System.out.print(aa);
}
}

B10033040陳姵儒 提到...

import java.util.*;
public class hello {

public static void main(String[] args) {
String a[]={"a[4]","a[3]","a[2]","a[1]","a[0]"};
LinkedList aa=new LinkedList();
for (int i=0; i<a.length ; i++)
aa.addFirst(a[i]);
aa.remove(3);
for (int i=0; i<a.length ;i++)
aa.add(a[i]);
System.out.println(aa);
// TODO Auto-generated method stub

}

}

B10033036邱筱婷 提到...

public static void main(String[] args) {
String a[]={"a[4]","a[3]","a[2]","a[1]","a[0]"};
LinkedList aa=new LinkedList();
for (int i=0; i<a.length ; i++)
aa.addFirst(a[i]);
aa.remove(3);
for (int i=0; i<a.length ;i++)
aa.add(a[i]);
System.out.println(aa);

}

}

B10033025林煒翔 提到...

import java.util.*;
public class link {
public static void main(String[] args) {
String a[]={"a[4]","a[3]","a[2]","a[1]","a[0]"};
LinkedList aa=new LinkedList();
for (int i=0; i<a.length;i++)
aa.add(a[i]);
aa.remove(3);
for (int i=0; i<a.length;i++)
aa.addFirst(a[i]);
aa.remove(3);
System.out.print(aa);
}

B9833151鄭宜青 提到...

import java.util.*;
public class B9833151
{
public static void main(String[] args)
{
String a[]={"a[4]","a[3]","a[2]","a[1]","a[0]"};
LinkedList aa=new LinkedList();
for (int i=0; i<a.length; i++)
aa.addFirst(a[i]);
aa.remove(3);
for (int i=0; i<a.length ;i++)
aa.add(a[i]);
System.out.println(aa);
}
}

B10033010 賴韋任 提到...

import java.util.*;
public class hello {

public static void main(String[] args) {
String a[]={"a[4]","a[3]","a[2]","a[1]","a[0]"};
LinkedList aa=new LinkedList();
for (int i=0; i<a.length ; i++)
aa.addFirst(a[i]);
aa.remove(3);
for (int i=0; i<a.length ;i++)
aa.add(a[i]);
System.out.println(aa);
// TODO Auto-generated method stub

}

}

B10033051羅宏彬 提到...

import java.util.*;
public class hello {

public static void main(String[] args) {
String a[]={"a[4]","a[3]","a[2]","a[1]","a[0]"};
LinkedList aa=new LinkedList();
for (int i=0; i<a.length ; i++)
aa.addFirst(a[i]);
aa.remove(3);
for (int i=0; i<a.length ;i++)
aa.add(a[i]);
System.out.println(aa);
// TODO Auto-generated method stub

}

}


B10033051羅宏彬 提到...

import java.util.*;
public class hello {

public static void main(String[] args) {
String a[]={"a[4]","a[3]","a[2]","a[1]","a[0]"};
LinkedList aa=new LinkedList();
for (int i=0; i<a.length ; i++)
aa.addFirst(a[i]);
aa.remove(3);
for (int i=0; i<a.length ;i++)
aa.add(a[i]);
System.out.println(aa);
// TODO Auto-generated method stub

}

}


B10033026姜禮銘 提到...

import java.util.*;
public class hello {

public static void main(String[] args) {
String a[]={"a[4]","a[3]","a[2]","a[1]","a[0]"};
LinkedList aa=new LinkedList();
for (int i=0; i<a.length ; i++)
aa.addFirst(a[i]);
aa.remove(3);
for (int i=0; i<a.length ;i++)
aa.add(a[i]);
System.out.println(aa);
// TODO Auto-generated method stub

}

}

b10033009沈哲文 提到...

import java.util.*;
public class test {
public static void main(String[] args) {
String a[]={"a[4]","a[3]","a[2]","a[1]","a[0]"};
LinkedList aa=new LinkedList();
for (int i=0; i<a.length;i++)
aa.add(a[i]);
aa.remove(3);
for (int i=0; i<a.length;i++)
aa.addFirst(a[i]);
aa.remove(3);
System.out.print(aa);
}
}

B10033054 鄭仲軒 提到...

import java.util.*;
public class ASD {

public static void main(String[] args) {
String a[]={"a[4]","a[3]","a[2]","a[1]","a[0]"};
LinkedList aa=new LinkedList();
for (int i=0; i<a.length ; i++)
aa.addFirst(a[i]);
aa.remove(3);
for (int i=0; i<a.length ;i++)
aa.add(a[i]);
System.out.println(aa);
// TODO Auto-generated method stub

}

}

B10033043史家郡 提到...

package p3;
import java.util.*;
public class love
{
public static void main(String[]args)
{
String a[]={"a[4]","a[3]","a[2]","a[1]","a[0]"};
LinkedList<String> aa=new LinkedList<String>();
for(int i=0;i<a.length;i++)
aa.addFirst(a[i]);
aa.remove(3);
for(int i=0;i<a.length;i++)
aa.add(a[i]);
aa.remove(7);
System.out.println(aa);
}
}

B10033030姜欣宜 提到...

import java.util.*;
public class B9833035 {
public static void main(String[] args) {
String a[]={"a[4]","a[3]","a[2]","a[1]","a[0]"};
LinkedList aa=new LinkedList();
for (int i=0; i<a.length; i++)
aa.addFirst(a[i]);
aa.remove(3);
for (int i=0; i<a.length ;i++)
aa.add(a[i]);
System.out.println(aa);

}

}

B9833108王冠傑 提到...

import java.util.*;
public class List {

public static void main (String[] args) {
String a[]={"FOUR","THREE","ONE","ZERO"};
LinkedList aa=new LinkedList{};
for(int i=0;i<a.length;i++)
aa.add(a[i]);
aa.remove(3);
for(int i=0;i<a.length;i++)
⋯⋯aa.addFirst(a[i]);
aa.remove(3);
Sytsem.out.println(aa);
}
}

B10033048劉雅琪 提到...

import java.util.*;
public class hello {

public static void main(String[] args) {
String a[]={"a[4]","a[3]","a[2]","a[1]","a[0]"};
LinkedList aa=new LinkedList();
for (int i=0; i<a.length ; i++)
aa.addFirst(a[i]);
aa.remove(3);
for (int i=0; i<a.length ;i++)
aa.add(a[i]);
System.out.println(aa);
// TODO Auto-generated method stub

}

}

B10033013王彥哲 提到...

import java.util.*;
public class link {
public static void main(String[] args) {
String a[]={"a[4]","a[3]","a[2]","a[1]","a[0]"};
LinkedList<String> aa=new LinkedList<String>();
for (int i=0; i<a.length;i++)
aa.add(a[i]);
aa.remove(3);
for (int i=0; i<a.length;i++)
aa.addFirst(a[i]);
aa.remove(3);
System.out.print(aa);
}
}

b9833084 王綱 提到...

import java.util.*;
public class B9833084
{
public static void main(String[] args) {
String a[]={"a[4]","a[3]","a[2]","a[1]","a[0]"};
LinkedList aa=new LinkedList();
for (int i=0; i<a.length; i++)
aa.addFirst(a[i]);
aa.remove(3);
for (int i=0; i<a.length ;i++)
aa.add(a[i]);
System.out.println(aa);
}
}

B10033006莊松霖 提到...

import java.util.*;
public class hello {

public static void main(String[] args) {
String a[]={"a[4]","a[3]","a[2]","a[1]","a[0]"};
LinkedList aa=new LinkedList();
for (int i=0; i<a.length ; i++)
aa.addFirst(a[i]);
aa.remove(3);
for (int i=0; i<a.length ;i++)
aa.add(a[i]);
System.out.println(aa);
// TODO Auto-generated method stub

}

}

B10033041陳奕綺 提到...

import java.util.*;
public class hello {

public static void main(String[] args) {
String a[]={"a[4]","a[3]","a[2]","a[1]","a[0]"};
LinkedList aa=new LinkedList();
for (int i=0; i<a.length ; i++)
aa.addFirst(a[i]);
aa.remove(3);
for (int i=0; i<a.length ;i++)
aa.add(a[i]);
System.out.println(aa);
// TODO Auto-generated method stub

}

}

B10033032夏瑋駿 提到...

import java.util.*;
public class good {

public static void main(String[] args) {
String a[]={"a[4]","a[3]","a[2]","a[1]","a[0]"};
LinkedList aa=new LinkedList();
for (int i=0; i<a.length ; i++)
aa.addFirst(a[i]);
aa.remove(3);
for (int i=0; i<a.length ;i++)
aa.add(a[i]);
System.out.println(aa);
// TODO Auto-generated method stub

}

}


匿名 提到...

B9733002鍾志捷
import java.util.*;
public class B9733002 {
public static void main(String[] args) {
String a[]={"a[4]","a[3]","a[2]","a[1]","a[0]"};
LinkedList aa=new LinkedList();
for (int i=0; i<a.length; i++)
aa.addFirst(a[i]);
aa.remove(3);
for (int i=0; i<a.length ;i++)
aa.add(a[i]);
aa.remove(7);
System.out.println(aa);

}

}

B9833108王冠傑 提到...

import java.util.*;
public class link {
public static void main(String[] args) {
String a[]={"a[4]","a[3]","a[2]","a[1]","a[0]"};
LinkedList aa=new LinkedList();
for (int i=0; i<a.length;i++)
aa.add(a[i]);
aa.remove(3);
for (int i=0; i<a.length;i++)
aa.addFirst(a[i]);
aa.remove(3);
System.out.print(aa);
}
}

B10033018張家忠 提到...

import java.util.*;
public class link {
public static void main(String[] args) {
String a[]={"a[4]","a[3]","a[2]","a[1]","a[0]"};
LinkedList aa=new LinkedList();
for (int i=0; i<a.length;i++)
aa.add(a[i]);
aa.remove(3);
for (int i=0; i<a.length;i++)
aa.addFirst(a[i]);
aa.remove(3);
System.out.print(aa);
}

B10033031游筑雅 提到...

import java.util.*;
public class link {
public static void main(String[] args) {
String a[]={"a[4]","a[3]","a[2]","a[1]","a[0]"};
LinkedList aa=new LinkedList();
for (int i=0; i<a.length;i++)
aa.add(a[i]);
aa.remove(3);
for (int i=0; i<a.length;i++)
aa.addFirst(a[i]);
aa.remove(3);
System.out.print(aa);
}

B10033049林昌輝 提到...

import java.util.*;
public class link {
public static void main(String[] args) {
String a[]={"a[4]","a[3]","a[2]","a[1]","a[0]"};
LinkedList aa=new LinkedList();
for (int i=0; i<a.length;i++)
aa.add(a[i]);
aa.remove(3);
for (int i=0; i<a.length;i++)
aa.addFirst(a[i]);
aa.remove(3);
System.out.print(aa);
}

b00033017 鄭人豪 提到...

import java.util.*;
public class hello {

public static void main(String[] args) {
String a[]={"a[4]","a[3]","a[2]","a[1]","a[0]"};
LinkedList aa=new LinkedList();
for (int i=0; i<a.length ; i++)
aa.addFirst(a[i]);
aa.remove(3);
for (int i=0; i<a.length ;i++)
aa.add(a[i]);
System.out.println(aa);
// TODO Auto-generated method stub

}

B10033047 黃鈺翔 提到...

package P1;
import java.util.*;
public class HW1 {
public static void main(String[] args) {
String a[]={"a[4]","a[3]","a[2]","a[1]","a[0]"};
LinkedList aa=new LinkedList();
for (int i=0; i<a.length; i++)
aa.addFirst(a[i]);
aa.remove(3);
for (int i=0; i<a.length ;i++)
aa.add(a[i]);
aa.remove(7);
System.out.println(aa);

}

}

Related Posts Plugin for WordPress, Blogger...

熱門文章