herrDeng網內搜尋

自訂搜尋

Ads

2013年11月18日 星期一

使用Java的LinkedList實作線性串列

有字串陣列
String a[]={"This", "is", "a", "string", "array"};
請利用Java的LinkedList實作線性串列如下:
["This", "is", "a", "string", "array","array","string","a","is","This"]

提示:請參閱下面程式擷圖

Java的LinkedList與連分數Continued Fraction

31 則留言:

B10133029 彭義竣 提到...

LinkedList<String> linkedList = new LinkedList<String>();
String[] a = {"This", "is", "a", "string", "array"};
for (int i = 0; i < a.length; i += 1) {
linkedList.addLast(a[i]);
}
for (int j = a.length - 1; j >= 0; j -= 1) {
linkedList.addLast(a[j]);
}
System.out.println(linkedList);

B10133048 饒家華 提到...

package kill;
import java.util.*;
public class CAI {

public static void main(String[] args) {
LinkedList<String>list=new LinkedList<String>();
String a[]={"This", "is", "a", "string", "array","array","string","a","is","This"};
for(int i=0; i<a.length; i++)
list.addLast(a[i]);
System.out.println(list);
while (!list.isEmpty()){
System.out.println(list.pop());
}

}

}

B10133042沈俞宜 提到...

public class ket {

public static void main(String[] args) {
LinkedList<String> linkedList = new LinkedList<String>();
String a[]={"This", "is", "a", "string", "array"};
for (int i = 0; i < a.length; i += 1) {
linkedList.addLast(a[i]);
}
for (int k = a.length - 1; k>= 0; k-= 1) {
linkedList.addLast(a[k]);
}
System.out.println(linkedList);

}

}

B10133033呂之筠 提到...

public class wen {

public static void main(String[] args) {
LinkedList<String> linkedList = new LinkedList<String>();
String a[]={"This", "is", "a", "string", "array"};
for (int i = 0; i < a.length; i += 1) {
linkedList.addLast(a[i]);
}
for (int k = a.length - 1; k>= 0; k-= 1) {
linkedList.addLast(a[k]);
}
System.out.println(linkedList);

}

}

B10133047鄭兆珊 提到...

public class san {

public static void main(String[] args) {
LinkedList<String> linkedList = new LinkedList<String>();
String a[]={"This", "is", "a", "string", "array"};
for (int i = 0; i < a.length; i += 1) {
linkedList.addLast(a[i]);
}
for (int k = a.length - 1; k>= 0; k-= 1) {
linkedList.addLast(a[k]);
}
System.out.println(linkedList);

}

}

B10133011 黃怡蓁 提到...

LinkedList<String> linkedList = new LinkedList<String>();
String[] a = {"This", "is", "a", "string", "array"};
for (int i = 0; i < a.length; i += 1)
  linkedList.addLast(a[i]);
for (int j = a.length - 1; j >= 0; j -= 1)
  linkedList.addLast(a[j]);
System.out.println(linkedList);

B10133002 謝佩紋 提到...

import java.util.*;
public class ex1 {

public static void main(String[] args) {
LinkedList linkedList = new LinkedList();
String a[]={"This", "is", "a", "string", "array"};
for (int i = 0; i < a.length; i += 1) {
linkedList.addLast(a[i]);
}
for (int k = a.length - 1; k>= 0; k-= 1) {
linkedList.addLast(a[k]);
}
System.out.println(linkedList);

}

}

B10133009 提到...

import java.util.LinkedList;
public class tt1 {
public static void main(String[] args) {
LinkedList<String> linkedList = new LinkedList<String>();
String[] a = {"This", "is", "a", "string", "array"};
for (int i = 0; i < a.length; i += 1) {
linkedList.addLast(a[i]);
}
for (int j = a.length - 1; j >= 0; j--) {
linkedList.addLast(a[j]);
}
System.out.println(linkedList);

}
}

B10133036孫翊玲 提到...

import java.util.*;
public class aa {

public static void main(String[] args) {
LinkedListlist=new LinkedList();
String a[]={"This", "is", "a", "string", "array","array","string","a","is","This"};
for(int i=0; i linkedList = new LinkedList();
String a[]={"This", "is", "a", "string", "array"};
for (int i = 0; i < a.length; i += 1) {
linkedList.addLast(a[i]);
}
for (int k = a.length - 1; k>= 0; k-= 1) {
linkedList.addLast(a[k]);
}
System.out.println(linkedList);

}

}

b10133023徐顥 提到...

LinkedList<String> linkedList = new LinkedList<String>();
String[] a = {"This", "is", "a", "string", "array"};
for (int i = 0; i < a.length; i += 1) {
linkedList.addLast(a[i]);
}
for (int j = a.length - 1; j >= 0; j -= 1) {
linkedList.addLast(a[j]);
}
System.out.println(linkedList);

b10033185邱詩婕 提到...

LinkedList<String> linkedList = new LinkedList<String>();
String[] a = {"This", "is", "a", "string", "array"};
for (int i = 0; i < a.length; i += 1) {
linkedList.addLast(a[i]);
}
for (int j = a.length - 1; j >= 0; j -= 1) {
linkedList.addLast(a[j]);
}
System.out.println(linkedList);

b10133016王致翔 提到...

LinkedList<String> linkedList = new LinkedList<String>();
String[] a = {"This", "is", "a", "string", "array"};
for (int i = 0; i < a.length; i += 1) {
linkedList.addLast(a[i]);
}
for (int j = a.length - 1; j >= 0; j -= 1) {
linkedList.addLast(a[j]);
}
System.out.println(linkedList);

B10133046邱誌寬 提到...

LinkedList<String> linkedList = new LinkedList<String>();
String[] a = {"This", "is", "a", "string", "array"};
for (int i = 0; i < a.length; i += 1) {
linkedList.addLast(a[i]);
}
for (int j = a.length - 1; j >= 0; j -= 1) {
linkedList.addLast(a[j]);
}
System.out.println(linkedList);

B10133045林玹安 提到...

LinkedList<String> linkedList = new LinkedList<String>();
String[] a = {"This", "is", "a", "string", "array"};
for (int i = 0; i < a.length; i += 1) {
linkedList.addLast(a[i]);
}
for (int j = a.length - 1; j >= 0; j -= 1) {
linkedList.addLast(a[j]);
}
System.out.println(linkedList);

B9933029江軒澔 提到...

public class san {

public static void main(String[] args) {
LinkedList linkedList = new LinkedList();
String a[]={"This", "is", "a", "string", "array"};
for (int i = 0; i < a.length; i += 1) {
linkedList.addLast(a[i]);
}
for (int k = a.length - 1; k>= 0; k-= 1) {
linkedList.addLast(a[k]);
}
System.out.println(linkedList);

}

}

b10133032黃徐琨 提到...

public class ket {

public static void main(String[] args) {
LinkedList<String> linkedList = new LinkedList<String>();
String a[]={"This", "is", "a", "string", "array"};
for (int i = 0; i < a.length; i += 1) {
linkedList.addLast(a[i]);
}
for (int k = a.length - 1; k>= 0; k-= 1) {
linkedList.addLast(a[k]);
}
System.out.println(linkedList);

}

}

B10133018翁湘姿 提到...

import java.util.*;
public class LANG {

public static void main(String[] args) {
LinkedListlist=new LinkedList();
String a[]={"This", "is", "a", "string", "array","array","string","a","is","This"};
for(int i=0; i linkedList = new LinkedList();
String a[]={"This", "is", "a", "string", "array"};
for (int i = 0; i < a.length; i += 1) {
linkedList.addLast(a[i]);
}
for (int k = a.length - 1; k>= 0; k-= 1) {
linkedList.addLast(a[k]);
}
System.out.println(linkedList);

}
}

B10133050張珈祥 提到...

package asd;
import java.util.*;
public class you {

public static void main(String[] args) {
LinkedListlist=new LinkedList();
String a[]={"This", "is", "a", "string", "array","array","string","a","is","This"};
for(int i=0; i<a.length; i++)
list.addLast(a[i]);
System.out.println(list);
while (!list.isEmpty()){
System.out.println(list.pop());
}

}

}

B10133053古聿穎 提到...

package sws;
import java.util.*;
public class swsw{

public static void main(String[] args) {
LinkedList<String>list=new LinkedList<String>();
String a[]={"This", "is", "a", "string", "array","array","string","a","is","This"};
for(int i=0; i<a.length; i++)
list.addLast(a[i]);
System.out.println(list);
while (!list.isEmpty()){
System.out.println(list.pop());
}

}

}

B10133030林潔如 提到...

package kill;
import java.util.*;
public class CAI {

public static void main(String[] args) {
LinkedListlist=new LinkedList();
String a[]={"This", "is", "a", "string", "array","array","string","a","is","This"};
for(int i=0; i<a.length; i++)
list.addLast(a[i]);
System.out.println(list);
while (!list.isEmpty()){
System.out.println(list.pop());
}

}

}

B10133014 吳欣怡 提到...

public class ex1 {

public static void main(String[] args) {
LinkedList<String> linkedList = new LinkedList<String>();
String a[]={"This", "is", "a", "string", "array"};
for (int i = 0; i < a.length; i += 1) {
linkedList.addLast(a[i]);
}
for (int k = a.length - 1; k>= 0; k-= 1) {
linkedList.addLast(a[k]);
}
System.out.println(linkedList);

}

}

B10133031 邱敏惠 提到...

public class abc {

public static void main(String[] args) {
LinkedList linkedList = new LinkedList();
String a[]={"This", "is", "a", "string", "array"};
for (int i = 0; i < a.length; i += 1) {
linkedList.addLast(a[i]);
}
for (int k = a.length - 1; k>= 0; k-= 1) {
linkedList.addLast(a[k]);
}
System.out.println(linkedList);
}
}

B10133013林子恩 提到...

LinkedList linkedList = new LinkedList();
String[] a = {"This", "is", "a", "string", "array"};
for (int i = 0; i < a.length; i += 1) {
linkedList.addLast(a[i]);
}
for (int j = a.length - 1; j >= 0; j -= 1) {
linkedList.addLast(a[j]);
}
System.out.println(linkedList);

B9933137 黃宇儂 提到...

public class B9933137 {

public static void main(String[] args) {
LinkedList linkedList = new LinkedList();
String a[]={"This", "is", "a", "string", "array"};
for (int i = 0; i < a.length; i += 1) {
linkedList.addLast(a[i]);
}
for (int k = a.length - 1; k>= 0; k-= 1) {
linkedList.addLast(a[k]);
}
System.out.println(linkedList);

}

}

B10133051張丞緯 提到...

public class ak {

public static void main(String[] args) {
LinkedList linkedList = new LinkedList();
String a[]={"This", "is", "a", "string", "array"};
for (int i = 0; i < a.length; i += 1) {
linkedList.addLast(a[i]);
}
for (int k = a.length - 1; k>= 0; k-= 1) {
linkedList.addLast(a[k]);
}
System.out.println(linkedList);

}

}

B10133044吳盛盟 提到...

LinkedList<String> linkedList = new LinkedList<String>();
String[] a = {"This", "is", "a", "string", "array"};
for (int i = 0; i < a.length; i += 1) {
linkedList.addLast(a[i]);
}
for (int j = a.length - 1; j >= 0; j -= 1) {
linkedList.addLast(a[j]);
}
System.out.println(linkedList);

B9933161廖佳穎 提到...

public class ket {

public static void main(String[] args) {
LinkedList linkedList = new LinkedList();
String a[]={"This", "is", "a", "string", "array"};
for (int i = 0; i < a.length; i += 1) {
linkedList.addLast(a[i]);
}
for (int k = a.length - 1; k>= 0; k-= 1) {
linkedList.addLast(a[k]);
}
System.out.println(linkedList);

}

}

B10133049 連于瑄 提到...

import java.util.*;
public class ex1 {

public static void main(String[] args) {
LinkedList linkedList = new LinkedList();
String a[]={"This", "is", "a", "string", "array"};
for (int i = 0; i < a.length; i += 1) {
linkedList.addLast(a[i]);
}
for (int k = a.length - 1; k>= 0; k-= 1) {
linkedList.addLast(a[k]);
}
System.out.println(linkedList);

}

}

b10133021吳屹軒 提到...

public class ket {

public static void main(String[] args) {
LinkedList<String> linkedList = new LinkedList<String>();
String a[]={"This", "is", "a", "string", "array"};
for (int i = 0; i < a.length; i += 1) {
linkedList.addLast(a[i]);
}
for (int k = a.length - 1; k>= 0; k-= 1) {
linkedList.addLast(a[k]);
}
System.out.println(linkedList);

}

}

B10133020 李涵清 提到...

public class ex1 {

public static void main(String[] args) {
LinkedList<String> linkedList = new LinkedList<String>();
String a[]={"This", "is", "a", "string", "array"};
for (int i = 0; i < a.length; i += 1) {
linkedList.addLast(a[i]);
}
for (int k = a.length - 1; k>= 0; k-= 1) {
linkedList.addLast(a[k]);
}
System.out.println(linkedList);

}

}

B10133008許耀文 提到...

package kill;
import java.util.*;
public class CAI {

public static void main(String[] args) {
LinkedListlist=new LinkedList();
String a[]={"This", "is", "a", "string", "array","array","string","a","is","This"};
for(int i=0; i<a.length; i++)
list.addLast(a[i]);
System.out.println(list);
while (!list.isEmpty()){
System.out.println(list.pop());
}

}

}

Related Posts Plugin for WordPress, Blogger...

熱門文章