有字串陣列
String a[]={"This", "is", "a", "string", "array"};
請利用Java的LinkedList實作線性串列如下:
["This", "is", "a", "string", "array","array","string","a","is","This"]
提示:請參閱下面程式擷圖
Java的LinkedList與連分數Continued Fraction
herrDeng網內搜尋

自訂搜尋
Ads
訂閱:
張貼留言 (Atom)
熱門文章
-
請用CPU-Z軟體檢測Cache & Memory 註:快取(L1-L3: SRAM) 第一級快取(L1)–通常存取只需要幾個週期,通常是幾十個KB。 第二級快取(L2)–比L1約有2到10倍較高延遲性,通常是幾百個KB或更多。 第三級快取(L3)(不...
-
計算gcd(123456789,999999999)
-
需要練習的Java程式:
-
C++ DP速解難題leetcode 3363 Find the Maximum Number of Fruits Collected [Python解請進]
-
輸入字串s 輸入int x 輸出 x個s
-
Leetcode 342 Power of Four幾個C++一行解 [codes on Leetcode] https://leetcode.com/problems/power-of-four/solutions/7081839/9-ways-of-bit-manipula...
-
問int怎麼存-689這個數字。 int用4個bytes。 答案請用16進位表達。
31 則留言:
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);
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());
}
}
}
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);
}
}
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);
}
}
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);
}
}
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);
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);
}
}
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);
}
}
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);
}
}
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);
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);
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);
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);
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);
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);
}
}
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);
}
}
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);
}
}
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());
}
}
}
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());
}
}
}
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());
}
}
}
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);
}
}
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);
}
}
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);
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);
}
}
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);
}
}
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);
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);
}
}
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);
}
}
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);
}
}
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);
}
}
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());
}
}
}
張貼留言