輸入字串陣列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.....
herrDeng網內搜尋
自訂搜尋
Ads
訂閱:
張貼留言 (Atom)
熱門文章
-
url="https://www.twse.com.tw/exchangeReport/STOCK_DAY?response=json&date=20220330&stockNo=2330"
-
教育部為提昇全民資安素養與電腦防護能力,本部於101年9月5日至11月5日舉辦「全民資安素養自我評量」活動,請在活動期間內踴躍上網檢測資訊安全素養認知程度,並有機會參與抽獎,詳情請參閱活動網站(網址: https://isafe.moe.edu.tw/event
-
python pandas對黃金、外匯匯率的爬蟲練習,並使用matplotlib.pyplot的函數plot, scatter做資料視覺化處理,採用numpy的統計函數,分析黃金價格波動與歐元走勢的關聯。
-
Python C C++ 2 pointer速解Leetcode 2337 Move Pieces to Obtain a String 多日Leetcode的問題都可用2-pointer法來解,今日2337. Move Pieces to Obtain a String也不例...
-
你會用C的算子sizeof?
48 則留言:
import java.util.*;
public class B1 {
public static void main(String[] args) {
String arr[]={"a[0]","a[1]","a[2]","a[3]","a[4]"};
LinkedList<String> list=new LinkedList<String>();
for(String x:arr)
list.add(x);
list.remove(3);
int y=4;
list.add(y,"a[4], a[3], a[2], a[0]");
System.out.println(list);
}
}
package V1;
import java.util.*;
public class B9933052A {
public static void main(String[] args) {
String arr[]={"a[0]","a[1]","a[2]","a[3]","a[4]"};
LinkedList<String> list=new LinkedList<String>();
for(String x:arr)
list.add(x);
list.remove(3);
int y=4;
list.add(y,"a[4], a[3], a[2], a[0]");
System.out.println(list);
}
}
import java.util.*;
public class a1 {
public static void main(String[] args) {
String arr[]={"你", "我", "他","YA","HI"};
LinkedList< String > list= new LinkedList< String >();
for (String x :arr)
list.addFirst(x);
list.remove(3);
int x=list.indexOf("HI");
if (x!=-1)
list.add(x,"你,他,YA,HI");
System.out.println(list);
}
}
package pack1;
import java.util.*;
public class a1{
public static void main(String[] args) {
String arr[]={"a[0]","a[1]","a[2]","a[3]","a[4]"};
LinkedList<String> list=new LinkedList<String>();
for(String x:arr)
list.add(x);
list.remove(3);
int y=4;
list.add(y,"a[4], a[3], a[2], a[0]");
System.out.println(list);
}
}
package P1;
import java.util.*;
public class B1 {
public static void main(String[] args) {
String arr[]={"a[0]","a[1]","a[2]","a[3]","a[4]"};
LinkedList<String> list= new LinkedList<String>();
for(String x:arr)
list.add(x);
list.remove(3);
int y=4;
list.add(y,"a[4], a[3], a[2], a[0]");
System.out.println(list);
}
}
import java.util.*;
public class b1 {
public static void main(String[] args) {
String arr[]={"a[0]","a[1]","a[2]","a[3]","a[4]"};
LinkedList<String> list=new LinkedList<String>();
for(String x:arr)
list.add(x);
list.remove(3);
int y=4;
list.add(y,"a[4], a[3], a[2], a[0]");
System.out.println(list);
}
}
package pack;
import java.util.*;
public class pack {
public static void main(String[] args) {
String arr[]={"a[0]","a[1]","a[2]","a[3]","a[4]"};
LinkedList<String> list=new LinkedList<String>();
for(String x:arr)
list.add(x);
list.remove(3);
int y=4;
list.add(y,"a[4], a[3], a[2], a[0]");
System.out.println(list);
}
}
package V1; import java.util.*; public class 2156415A { public static void main(String[] args) { String arr[]={"a[0]","a[1]","a[2]","a[3]","a[4]"}; LinkedList<String> list=new LinkedList<String>(); for(String x:arr) list.add(x); list.remove(3); int y=4; list.add(y,"a[4], a[3], a[2], a[0]"); System.out.println(list); } }
package V1; import java.util.*; public class 2156415A { public static void main(String[] args) { String arr[]={"a[0]","a[1]","a[2]","a[3]","a[4]"}; LinkedList<String> list=new LinkedList<String>(); for(String x:arr) list.add(x); list.remove(3); int y=4; list.add(y,"a[4], a[3], a[2], a[0]"); System.out.println(list); } }
package V1; import java.util.*; public class 2156415A { public static void main(String[] args) { String arr[]={"a[0]","a[1]","a[2]","a[3]","a[4]"}; LinkedList<String> list=new LinkedList<String>(); for(String x:arr) list.add(x); list.remove(3); int y=4; list.add(y,"a[4], a[3], a[2], a[0]"); System.out.println(list); } }
package V1; import java.util.*; public class 2156415A { public static void main(String[] args) { String arr[]={"a[0]","a[1]","a[2]","a[3]","a[4]"}; LinkedList<String> list=new LinkedList<String>(); for(String x:arr) list.add(x); list.remove(3); int y=4; list.add(y,"a[4], a[3], a[2], a[0]"); System.out.println(list); } }
package V1; import java.util.*; public class 2156415A { public static void main(String[] args) { String arr[]={"a[0]","a[1]","a[2]","a[3]","a[4]"}; LinkedList<String> list=new LinkedList<String>(); for(String x:arr) list.add(x); list.remove(3); int y=4; list.add(y,"a[4], a[3], a[2], a[0]"); System.out.println(list); } }
package p1;
import java.util.*;
public class b1 {
/**
* @param args
*/
public static void main(String[] args) {
// TODO Auto-generated method stub
String arr[]={"a[0]", "a[1]", "a[2]","a[3]","a[4]"};
LinkedList< String > list= new LinkedList< String >();
for (String x :arr)
list.add(x);
list.remove(3);
int y=4;
list.add(y,"a[4],a[3], a[2],a[0]");
System.out.println(list);
}
}
package pack1;
import java.util.*;
public class A1 {
public static void main(String[] args) {
String arr[]={"a[0]","a[1]","a[2]","a[3]","a[4]"};
LinkedList< String > list= new LinkedList< String >();
for (String x :arr)
list.add(x);
list.remove(3);
int y=4;
list.add(y,"a[4], a[3], a[2], a[0]");
System.out.println(list);
}
}
String arr[]={"a[0]","a[1]","a[2]","a[3]","a[4]"}; LinkedList<String> list=new LinkedList<String>(); for(String x:arr) list.add(x); list.remove(3); int y=4; list.add(y,"a[4], a[3], a[2], a[0]"); System.out.println(list);
String arr[]={"a[0]","a[1]","a[2]","a[3]","a[4]"}; LinkedList<String> list=new LinkedList<String>(); for(String x:arr) list.add(x); list.remove(3); int y=4; list.add(y,"a[4], a[3], a[2], a[0]"); System.out.println(list);
package p1;
import java.util.*;
public class B1 {
/**
* @param args
*/
public static void main(String[] args) {
// TODO Auto-generated method stub
String arr[]={"a[0]", "a[1]", "a[2]", "a[3]", "a[4]"};
LinkedList<String> list=new LinkedList<String>();
for (String x :arr)
list.add(x);
list.remove(3);
int y=4;
list.add(y,"a[4], a[3] ,a[2], a[0]");
System.out.println(list);
}
}
package p1;
import java.util.*;
public class ex1
{
public static void main(String[] args)
{
String arr[]={"a[0]", "a[1]", "a[2]","a[3]","a[4]"};
LinkedList< String > list= new LinkedList< String >();
for (String x :arr)
list.add(x);
list.remove(3);
int y=4;
list.add(y,"a[4], a[3], a[2], a[0]");
System.out.println(list);
}
}
package p1;
import java.util.*;
public class B1 {
/**
* @param args
*/
public static void main(String[] args) {
// TODO Auto-generated method stub
String arr[]={"a[0]", "a[1]", "a[2]", "a[3]", "a[4]"};
LinkedList<String> list=new LinkedList<String>();
for (String x :arr)
list.add(x);
list.remove(3);
int y=4;
list.add(y,"a[4], a[3] ,a[2], a[0]");
System.out.println(list);
}
}
package p1;
import java.util.*;
public class ex1
{
public static void main(String[] args)
{
String arr[]={"a[0]", "a[1]", "a[2]","a[3]","a[4]"};
LinkedList< String > list= new LinkedList< String >();
for (String x :arr)
list.add(x);
list.remove(3);
int y=4;
list.add(y,"a[4], a[3], a[2], a[0]");
System.out.println(list);
}
}
String arr[]={"a[0]","a[1]","a[2]","a[3]","a[4]"}; LinkedList<String> list=new LinkedList<String>(); for(String x:arr) list.add(x); list.remove(3); int y=4; list.add(y,"a[4], a[3], a[2], a[0]"); System.out.println(list);
String arr[]={"a[0]","a[1]","a[2]","a[3]","a[4]"}; LinkedList<String> list=new LinkedList<String>(); for(String x:arr) list.add(x); list.remove(3); int y=4; list.add(y,"a[4], a[3], a[2], a[0]"); System.out.println(list);
package p1;
import java.util.*;
public class B1 {
/**
* @param args
*/
public static void main(String[] args) {
// TODO Auto-generated method stub
String arr[]={"a[0]", "a[1]", "a[2]", "a[3]", "a[4]"};
LinkedList<String> list=new LinkedList<String>();
for (String x :arr)
list.add(x);
list.remove(3);
int y=4;
list.add(y,"a[4], a[3] ,a[2], a[0]");
System.out.println(list);
}
}
String arr[]={"a[0]","a[1]","a[2]","a[3]","a[4]"}; LinkedList<String> list=new LinkedList<String>(); for(String x:arr) list.add(x); list.remove(3); int y=4; list.add(y,"a[4], a[3], a[2], a[0]"); System.out.println(list);
package p1;
import java.util.*;
public class B1 {
/**
* @param args
*/
public static void main(String[] args) {
// TODO Auto-generated method stub
String arr[]={"a[0]", "a[1]", "a[2]", "a[3]", "a[4]"};
LinkedList<String> list=new LinkedList<String>();
for (String x :arr)
list.add(x);
list.remove(3);
int y=4;
list.add(y,"a[4], a[3] ,a[2], a[0]");
System.out.println(list);
}
}
String arr[]={"a[0]","a[1]","a[2]","a[3]","a[4]"}; LinkedList<String> list=new LinkedList<String>(); for(String x:arr) list.add(x); list.remove(3); int y=4; list.add(y,"a[4], a[3], a[2], a[0]"); System.out.println(list);
package p1;
import java.util.*;
public class b1 {
/**
* @param args
*/
public static void main(String[] args) {
// TODO Auto-generated method stub
String arr[]={"a[0]", "a[1]", "a[2]","a[3]","a[4]"};
LinkedList< String > list= new LinkedList< String >();
for (String x :arr)
list.add(x);
list.remove(3);
int y=4;
list.add(y,"a[0],a[1],a[2],a[3],a[4]");
System.out.println(list);
}
}
package pack1;
import java.util.*;
public class t1 {
public static void main(String[] args) {
String arr[]={"a[0]", "a[1]", "a[2]","a[3]","a[4]"};
LinkedList< String > list= new LinkedList< String >();
for (String x :arr)
list.add(x);
list.remove(3);
int y=4;
list.add(y,"a[0], a[1], a[2],a[3],a[4]");
System.out.println(list);
}
}
package p1;
import java.util.*;
public class B1 {
/**
* @param args
*/
public static void main(String[] args) {
// TODO Auto-generated method stub
String arr[]={"a[0]", "a[1]", "a[2]", "a[3]", "a[4]"};
LinkedList<String> list=new LinkedList<String>();
for (String x :arr)
list.add(x);
list.remove(3);
int y=4;
list.add(y,"a[4], a[3] ,a[2], a[0]");
System.out.println(list);
}
}
String arr[]={"a[0]","a[1]","a[2]","a[3]","a[4]"}; LinkedList<String> list=new LinkedList<String>(); for(String x:arr) list.add(x); list.remove(3); int y=4; list.add(y,"a[4], a[3], a[2], a[0]"); System.out.println(list);
package p1;
import java.util.*;
public class B1 {
/**
* @param args
*/
public static void main(String[] args) {
// TODO Auto-generated method stub
String arr[]={"a[0]", "a[1]", "a[2]", "a[3]", "a[4]"};
LinkedList<String> list=new LinkedList<String>();
for (String x :arr)
list.add(x);
list.remove(3);
int y=4;
list.add(y,"a[4], a[3] ,a[2], a[0]");
System.out.println(list);
}
}
package A11;
import java.util.*;
public class A11 {
public static void main(String[] args) {
String arr[]={"YA", "拉", "嘻","u","dk" };
LinkedList< String > list= new LinkedList< String >();
for (String x :arr)
list.addFirst(x);
list.remove(3);
int x=list.indexOf("dk");
if (x!=-1)
list.add(x,"YA,嘻,u,dk" );
System.out.println(list);
}
}
package a1;
import java.util.*;
public class p1 {
public static void main(String[] args) {
String arr[]={"a[0]", "a[1]", "a[2]", "a[3]", "a[4]"};
LinkedList< String > list= new LinkedList< String >();
for (String x :arr)
list.add(x);
list.remove("a[3]");
list.add("a[4]");
list.add("a[3]");
list.add("a[2]");
list.add("a[0]");
System.out.println(list);
}
}
package a1;
import java.util.*;
public class p1 {
public static void main(String[] args) {
String arr[]={"a[0]", "a[1]", "a[2]", "a[3]", "a[4]"};
LinkedList< String > list= new LinkedList< String >();
for (String x :arr)
list.add(x);
list.remove("a[3]");
list.add("a[4]");
list.add("a[3]");
list.add("a[2]");
list.add("a[0]");
System.out.println(list);
}
}
package V1;
import java.util.*;
public class 12A {
public static void main(String[] args) {
Stringarr[]={“a[0]”, “a[1]”, “a[2]”, “a[3]”, “a[4]”};
LinkedList<<String> list=new LinkedList<<String>();
for(String x :arr)
list.add(x);
list.remove(3);
int y=4;
list.add(y,"a[4], a[3], a[2], a[0]);
System.out.println(list);
}
}
import java.util.*;
class test1114
{
public static void main(String[] args)
{
String arr[]={"a[0]","a[1]","a[2]","a[3]","a[4]"};
LinkedList<String> list=new LinkedList<String>();
list.add("a[4]");
list.add("a[3]");
list.add("a[2]");
list.add("a[0]");
System.out.print(list);
}
}
package P1 ;
import java.util.*;
class A{
public static void main(String[] args)
{
String arr[]={"a[0]","a[1]","a[2]","a[3]","a[4]"};
LinkedList<String> list=new LinkedList<String>();
for(String x:arr)
list.add(x);
list.remove(3);
list.add("a[4]");
list.add("a[3]");
list.add("a[2]");
list.add("a[0]");
System.out.print(list);
}
}
import java.util.*;
public class B9933024 {
[public static void main(String[] args)
[{
[[String arr[]={"a[0]","a[1]","a[2]","a[3]","a[4]"};
LinkedList<String> list=new LinkedList<String>();
for(String x:arr)
[[list.add(x);
list.remove(3);
list.add("a[4]");
[[list.add("a[3]");
[[list.add("a[2]");
[[list.add("a[0]");
[System.out.print(list);
}
}
import java.util.*;
public class A2
{
public static void main(String[] args)
{
String arr[]={ "喜", "怒", "哀", "樂", "嘆" };
LinkedList< String > list= new LinkedList< String >();
for (String x :arr)
list.addFirst(x);
list.remove(3);
int x=list.indexOf("嘆");
if (x!=-1)
list.add(x,"喜, 怒, 哀, 嘆" );
System.out.println(list);
}
}
import java.util.*;
public class B9933051
{
public static void main(String[] args)
{
String arr[]={"I","YOU","SHE","HE","IT"};
LinkedList<String> list=new LinkedList<String>();
for(String x:arr)
list.add(x);
list.remove(3);
list.add("IT");
list.add("HE");
list.add("SHE");
list.add("I");
System.out.print(list);
}
}
package pack1;
import java.util.*;
public class A1 {
public static void main(String[] args) {
String arr[]={"a[0]","a[1]","a[2]","a[3]","a[4]"};
LinkedList< String > list= new LinkedList< String >();
for (String x :arr)
list.add(x);
list.remove(3);
int y=4;
list.add(y,"a[4], a[3], a[2], a[0]");
System.out.println(list);
}
}
import java.util.*;
class b9733054
{
public static void main(String[] args)
{
String arr[]={"a[0]","a[1]","a[2]","a[3]","a[4]"};
LinkedList<String> list=new LinkedList<String>();
for(String x:arr)
list.add(x);
list.remove(3);
list.add("a[4]");
list.add("a[3]");
list.add("a[2]");
list.add("a[0]");
System.out.print(list);
}
}
package B1; import java.util.*; public class D { public static void main(String[] args) { String arr[]={"a[0]","a[1]","a[2]","a[3]","a[4]"}; LinkedList<String> list=new LinkedList<String>(); for(String x:arr) list.add(x); list.remove(3); int y=4; list.add(y,"a[4], a[3], a[2], a[0]"); System.out.println(list); } }
package B1; import java.util.*; public class D { public static void main(String[] args) { String arr[]={"a[0]","a[1]","a[2]","a[3]","a[4]"}; LinkedList<String> list=new LinkedList<String>(); for(String x:arr) list.add(x); list.remove(3); int y=4; list.add(y,"a[4], a[3], a[2], a[0]"); System.out.println(list); } }
package B1; import java.util.*; public class D { public static void main(String[] args) { String arr[]={"a[0]","a[1]","a[2]","a[3]","a[4]"}; LinkedList<String> list=new LinkedList<String>(); for(String x:arr) list.add(x); list.remove(3); int y=4; list.add(y,"a[4], a[3], a[2], a[0]"); System.out.println(list); } }
package A3;
import java.util.*;
public class A5 {
public static void main(String[] args) { String arr[]={"a[0]","a[1]","a[2]","a[3]","a[4]"}; LinkedList<String> list=new LinkedList<String>(); for(String x:arr) list.add(x); list.remove(3); int y=4; list.add(y,"a[4], a[3], a[2], a[0]"); System.out.println(list); } }
package A3;
import java.util.*;
public class A5 {
public static void main(String[] args) { String arr[]={"a[0]","a[1]","a[2]","a[3]","a[4]"}; LinkedList<String> list=new LinkedList<String>(); for(String x:arr) list.add(x); list.remove(3); int y=4; list.add(y,"a[4], a[3], a[2], a[0]"); System.out.println(list); } }.
String arr[]={"a[0]","a[1]","a[2]","a[3]","a[4]"}; LinkedList list=new LinkedList(); for(String x:arr) list.add(x); list.remove(3); int y=4; list.add(y,"a[4], a[3], a[2], a[0]"); System.out.println(list);
張貼留言