herrDeng網內搜尋

自訂搜尋

Ads

2016年11月16日 星期三

Ex11. 利用LinkedList寫鍊結串列

造出一個鍊結串列如下:
[Bill:20, 老三:15, 小王:689, 小王:689, 老三:15, Bill:20]


43 則留言:

B10433044吳玉瀚 提到...

import java.util.*;
class Term{
String name;
int score;
Term(String name, int score){
this.name=name;
this.score=score;
}
public String toString(){
return name+":"+score;
}
}
public class Main {
public static void main(String[] args) {
LinkedList f=new LinkedList();
f.addFirst(new Term("小王", 689));
f.addFirst(new Term("老三",15));
f.addFirst(new Term("Bill",20));
f.addLast(new Term("小王",689));
f.addLast(new Term("老三",15));
f.addLast(new Term("Bill",20));
System.out.println(f);
}
}

B10433023李佳明 提到...

import java.util.LinkedList;
class Term{
String name;
int score;
Term(String name, int score){
this.name=name;
this.score=score;
}
public String toString(){
return name+":"+score;
}
}
public class Main {
public static void main(String[] args) {
LinkedList f=new LinkedList();
f.push(new Term("Bill",20));
f.push(new Term("老三",15));
f.push(new Term("小王", 689));
f.push(new Term("小王", 689));
f.push(new Term("老三",15));
f.push(new Term("Bill",20));
System.out.println(f);
}
}
-------------------------------------------------------

[Bill:20, 老三:15, 小王:689, 小王:689, 老三:15, Bill:20]

B10433036 提到...

import java.util.LinkedList;
class Term{
String name;
long score;
Term(String name, int score){
this.name=name;
this.score=score;
}
public String toString(){
return name+":"+score;
}
}
public class ex1{
public static void main(String[] args) {
LinkedList f=new LinkedList();
f.push(new Term("Bill",20));
System.out.println(f);
f.push(new Term("老三",15));
System.out.println(f);
f.push(new Term("小王", 689));
System.out.println(f);
f.push(new Term("小王", 689));
System.out.println(f);
f.push(new Term("老三",15));
System.out.println(f);
f.push(new Term("Bill",20));
System.out.println(f);

f.pop();
System.out.println(f);
}
}

B10433014楊偉杰 提到...

import java.util.LinkedList;
class Term{
String name;
int score;
Term(String name, int score){
this.name=name;
this.score=score;
}
public String toString(){
return name+":"+score;
}
}
public class zzz {
public static void main(String[] args) {
LinkedList f=new LinkedList();
f.push(new Term("Bill",20));

f.push(new Term("老三",15));

f.push(new Term("小王", 689));

f.push(new Term("小王", 689));

f.push(new Term("老三",15));

f.push(new Term("Bill",20));
System.out.println(f);

}
}
Bill:20, 老三:15, 小王:689, 小王:689, 老三:15, Bill:20

B10433046 提到...

import java.util.LinkedList;
class Term{
String name;
int score;
Term(String name, int score){
this.name=name;
this.score=score;
}
public String toString(){
return name+":"+score;
}
}
public class Main {
public static void main(String[] args) {
LinkedList f=new LinkedList();
f.push(new Term("Bill",20));

f.push(new Term("老三",15));

f.push(new Term("小王", 689));

f.push(new Term("小王", 689));

f.push(new Term("老三",15));

f.push(new Term("Bill",20));
System.out.println(f);
}
}

B10433042 提到...

package faaa;
import java.util.LinkedList;

class Term{
String name;
int score;
Term(String name, int score){
this.name=name;
this.score=score;
}
public String toString(){
return name+":"+score;
}
}
public class god {
public static void main(String[] args) {
LinkedList f=new LinkedList();
f.push(new Term("Bill",20));

f.push(new Term("老三",15));

f.push(new Term("小王", 689));

f.push(new Term("小王", 689));

f.push(new Term("老三",15));

f.push(new Term("Bill",20));
System.out.println(f);

}
}

B10433027 提到...

import java.util.LinkedList;



class Term{

String name;

int score;

Term(String name,int score){

this.name=name;

this.score=score;

}

public String toString(){

return name+":"+score;

}

}

public class Main {

public static void main(String[] args){

LinkedList f=new LinkedList();

f.push(new Term("bill",426));

System.out.println(f);

f.push(new Term("老三",15));

System.out.println(f);

f.push(new Term("小玉",689));

System.out.println(f);

f.push(new Term("小玉",689));

System.out.println(f);

f.push(new Term("老三",15));

System.out.println(f);

f.push(new Term("bill",426));

System.out.println(f);

//f.pop();

//System.out.println(f);

}



}

B10433037 提到...

import java.util.LinkedList;
class Term{
String name;
int score;
Term(String name, int score){
this.name=name;
this.score=score;
}
public String toString(){
return name+":"+score;
}
}
public class B10433037 {
public static void main(String[] args) {
LinkedList f=new LinkedList();
f.push(new Term("Bill",20));
System.out.println(f);
f.push(new Term("老三",15));
System.out.println(f);
f.push(new Term("小王", 689));
System.out.println(f);
f.push(new Term("小王", 689));
System.out.println(f);
f.push(new Term("老三",15));
System.out.println(f);
f.push(new Term("Bill",20));
System.out.println(f);
f.pop();
System.out.println(f);
}
}

B10433025 提到...

package faaa;
import java.util.LinkedList;

class Term{
String name;
int score;
Term(String name, int score){
this.name=name;
this.score=score;
}
public String toString(){
return name+":"+score;
}
}
public class god {
public static void main(String[] args) {
LinkedList f=new LinkedList();
f.push(new Term("Bill",20));

f.push(new Term("老三",15));

f.push(new Term("小王", 689));

f.push(new Term("小王", 689));

f.push(new Term("老三",15));

f.push(new Term("Bill",20));
System.out.println(f);

}
}

B10333022李昕翰 提到...

import java.util.LinkedList;
class Term{
String name;
int score;
Term(String name, int score){
this.name=name;
this.score=score;
}
public String toString(){
return name+":"+score;
}
}
public class Main {
public static void main(String[] args) {
LinkedList f=new LinkedList();
f.push(new Term("Bill",20));
f.push(new Term("老三",15));
f.push(new Term("小王", 689));
f.push(new Term("小王", 689));
f.push(new Term("老三",15));
f.push(new Term("Bill",20));
System.out.println(f);
}
}
-------------------------------------------------------

[Bill:20, 老三:15, 小王:689, 小王:689, 老三:15, Bill:20]

B10233028 王曉琪 提到...

import java.util.LinkedList;
class Term{
String name;
int score;
Term(String name, int score){
this.name=name;
this.score=score;
}
public String toString(){
return name+":"+score;
}
}
public class Main {
public static void main(String[] args) {
LinkedList f=new LinkedList();
f.push(new Term("Bill",20));
f.push(new Term("老三",15));
f.push(new Term("小王", 689));
f.push(new Term("小王", 689));
f.push(new Term("老三",15));
f.push(new Term("Bill",20));
System.out.println(f);
}
}

B10433022 吳欣芸 提到...

import java.util.LinkedList;
class p1{
String name;
int score;
Term(String name, int score){
this.name=name;
this.score=score;
}
public String toString(){
return name+":"+score;
}
}
public class p2{
public static void main(String[] args) {
LinkedList f=new LinkedList();
f.push(new Term("Bill",20));
f.push(new Term("老三",15));
f.push(new Term("小王", 689));
f.push(new Term("小王", 689));
f.push(new Term("老三",15));
f.push(new Term("Bill",20));
System.out.println(f);
}
}
-------------------------------------------------------

[Bill:20, 老三:15, 小王:689, 小王:689, 老三:15, Bill:20]

B10333010陳彥逸 提到...

import java.util.LinkedList;
class p1{
String name;
int score;
Term(String name, int score){
this.name=name;
this.score=score;
}
public String toString(){
return name+":"+score;
}
}
public class p2{
public static void main(String[] args) {
LinkedList f=new LinkedList();
f.push(new Term("Bill",20));
f.push(new Term("老三",15));
f.push(new Term("小王", 689));
f.push(new Term("小王", 689));
f.push(new Term("老三",15));
f.push(new Term("Bill",20));
System.out.println(f);
}
}
-------------------------------------------------------

[Bill:20, 老三:15, 小王:689, 小王:689, 老三:15, Bill:20]

B10433188 姜佩萱 提到...

import java.util.LinkedList;
class p1{
String name;
int score;
Term(String name, int score){
this.name=name;
this.score=score;
}
public String toString(){
return name+":"+score;
}
}
public class p2{
public static void main(String[] args) {
LinkedList f=new LinkedList();
f.push(new Term("Bill",20));
f.push(new Term("老三",15));
f.push(new Term("小王", 689));
f.push(new Term("小王", 689));
f.push(new Term("老三",15));
f.push(new Term("Bill",20));
System.out.println(f);
}
}

B10433190 張文翰 提到...

import java.util.LinkedList;
class p1{
String name;
int score;
Term(String name, int score){
this.name=name;
this.score=score;
}
public String toString(){
return name+":"+score;
}
}
public class p2{
public static void main(String[] args) {
LinkedList f=new LinkedList();
f.push(new Term("Bill",20));
f.push(new Term("老三",15));
f.push(new Term("小王", 689));
f.push(new Term("小王", 689));
f.push(new Term("老三",15));
f.push(new Term("Bill",20));
System.out.println(f);
}
}

B104333050徐佳偉 提到...

import java.util.LinkedList;
class Term{
String name;
int score;
Term(String name, int score){
this.name=name;
this.score=score;
}
public String toString(){
return name+":"+score;
}
}
public class Main {
public static void main(String[] args) {
LinkedList f=new LinkedList();
f.push(new Term("Bill",20));
f.push(new Term("老三",15));
f.push(new Term("小王", 689));
f.push(new Term("小王", 689));
f.push(new Term("老三",15));
f.push(new Term("Bill",20));
System.out.println(f);
}
}

B10433031陳頌恩 提到...

import java.util.LinkedList;
class p1{
String name;
int score;
Term(String name, int score){
this.name=name;
this.score=score;
}
public String toString(){
return name+":"+score;
}
}
public class p2{
public static void main(String[] args) {
LinkedList f=new LinkedList();
f.push(new Term("Bill",20));
f.push(new Term("老三",15));
f.push(new Term("小王", 689));
f.push(new Term("小王", 689));
f.push(new Term("老三",15));
f.push(new Term("Bill",20));
System.out.println(f);
}
}

B10433066劉民崧 提到...

import java.util.LinkedList;
class p1{
String name;
int score;
Term(String name, int score){
this.name=name;
this.score=score;
}
public String toString(){
return name+":"+score;
}
}
public class p2{
public static void main(String[] args) {
LinkedList f=new LinkedList();
f.push(new Term("Bill",20));
f.push(new Term("老三",15));
f.push(new Term("小王", 689));
f.push(new Term("小王", 689));
f.push(new Term("老三",15));
f.push(new Term("Bill",20));
System.out.println(f);
}
}

B10433010吳奇峰 提到...

import java.util.LinkedList;
class p1{
String name;
int score;
Term(String name, int score){
this.name=name;
this.score=score;
}
public String toString(){
return name+":"+score;
}
}
public class p2{
public static void main(String[] args) {
LinkedList f=new LinkedList();
f.push(new Term("Bill",20));
f.push(new Term("老三",15));
f.push(new Term("小王", 689));
f.push(new Term("小王", 689));
f.push(new Term("老三",15));
f.push(new Term("Bill",20));
System.out.println(f);
}
}

B10433189杜恩瑋 提到...

import java.util.LinkedList;
class p1{
String name;
int score;
Term(String name, int score){
this.name=name;
this.score=score;
}
public String toString(){
return name+":"+score;
}
}
public class p2{
public static void main(String[] args) {
LinkedList f=new LinkedList();
f.push(new Term("Bill",20));
f.push(new Term("老三",15));
f.push(new Term("小王", 689));
f.push(new Term("小王", 689));
f.push(new Term("老三",15));
f.push(new Term("Bill",20));
System.out.println(f);
}
}

B10433039游叡恩 提到...

import java.util.LinkedList;
class Term{
String name;
int score;
Term(String name, int score){
this.name=name;
this.score=score;
}
public String toString(){
return name+":"+score;
}
}
public class Main {
public static void main(String[] args) {
LinkedList f=new LinkedList();
f.push(new Term("Bill",20));
f.push(new Term("老三",15));
f.push(new Term("小王", 689));
f.push(new Term("小王", 689));
f.push(new Term("老三",15));
f.push(new Term("Bill",20));
System.out.println(f);
}
}

b10433030 楊家睿 提到...

import java.util.LinkedList;
class Term{
String name;
int score;
Term(String name, int score){
this.name=name;
this.score=score;
}
public String toString(){
return name+":"+score;
}
}
public class zzz {
public static void main(String[] args) {
LinkedList f=new LinkedList();
f.push(new Term("Bill",20));

f.push(new Term("老三",15));

f.push(new Term("小王", 689));

f.push(new Term("小王", 689));

f.push(new Term("老三",15));

f.push(new Term("Bill",20));
System.out.println(f);

}
}

B10433029 宋狄淯 提到...

mport java.util.LinkedList;
class Term{
String name;
int score;
Term(String name, int score){
this.name=name;
this.score=score;
}
public String toString(){
return name+":"+score;
}
}
public class Main {
public static void main(String[] args) {
LinkedList f=new LinkedList();
f.push(new Term("Bill",20));
f.push(new Term("老三",15));
f.push(new Term("小王", 689));
f.push(new Term("小王", 689));
f.push(new Term("老三",15));
f.push(new Term("Bill",20));
System.out.println(f);
}
}

b10433030 楊家睿 提到...

import java.util.LinkedList;
class Term{
String name;
int score;
Term(String name, int score){
this.name=name;
this.score=score;
}
public String toString(){
return name+":"+score;
}
}
public class Main {
public static void main(String[] args) {
LinkedList f=new LinkedList();
f.push(new Term("Bill",20));
f.push(new Term("老三",15));
f.push(new Term("小王", 689));
f.push(new Term("小王", 689));
f.push(new Term("老三",15));
f.push(new Term("Bill",20));
System.out.println(f);
}
}

B10433005 沈沛姍 提到...

import java.util.*;
class Term{
String name;
int score;
Term(String name, int score){
this.name=name;
this.score=score;
}
public String toString(){
return name+":"+score;
}
}
public class Main {
public static void main(String[] args) {
LinkedList f=new LinkedList();
f.addFirst(new Term("小王", 689));
f.addFirst(new Term("老三",15));
f.addFirst(new Term("Bill",20));
f.addLast(new Term("小王",689));
f.addLast(new Term("老三",15));
f.addLast(new Term("Bill",20));
System.out.println(f);
}
}

B10433009 蔡佩樺 提到...

import java.util.*;
class Term{
String name;
int score;
Term(String name, int score){
this.name=name;
this.score=score;
}
public String toString(){
return name+":"+score;
}
}
public class Main {
public static void main(String[] args) {
LinkedList f=new LinkedList();
f.addFirst(new Term("小王", 689));
f.addFirst(new Term("老三",15));
f.addFirst(new Term("Bill",20));
f.addLast(new Term("小王",689));
f.addLast(new Term("老三",15));
f.addLast(new Term("Bill",20));
System.out.println(f);
}
}

B10433019 李佳潔 提到...

import java.util.*;
class Term{
String name;
int score;
Term(String name, int score){
this.name=name;
this.score=score;
}
public String toString(){
return name+":"+score;
}
}
public class Main {
public static void main(String[] args) {
LinkedList f=new LinkedList();
f.addFirst(new Term("小王", 689));
f.addFirst(new Term("老三",15));
f.addFirst(new Term("Bill",20));
f.addLast(new Term("小王",689));
f.addLast(new Term("老三",15));
f.addLast(new Term("Bill",20));
System.out.println(f);
}
}

B10433054 孫若庭 提到...

import java.util.*;
class Term{
String name;
int score;
Term(String name, int score){
this.name=name;
this.score=score;
}
public String toString(){
return name+":"+score;
}
}
public class Main {
public static void main(String[] args) {
LinkedList f=new LinkedList();
f.addFirst(new Term("小王", 689));
f.addFirst(new Term("老三",15));
f.addFirst(new Term("Bill",20));
f.addLast(new Term("小王",689));
f.addLast(new Term("老三",15));
f.addLast(new Term("Bill",20));
System.out.println(f);
}
}

B10233177吳國豪 提到...

import java.util.*;
class Term{
String name;
int score;
Term(String name, int score){
this.name=name;
this.score=score;
}
public String toString(){
return name+":"+score;
}
}
public class Main {
public static void main(String[] args) {
LinkedList f=new LinkedList();
f.addFirst(new Term("小王", 689));
f.addFirst(new Term("老三",15));
f.addFirst(new Term("Bill",20));
f.addLast(new Term("小王",689));
f.addLast(new Term("老三",15));
f.addLast(new Term("Bill",20));
System.out.println(f);
}
}

B10233049 黃家崙 提到...

import java.util.*;
class Term{
String name;
int score;
Term(String name, int score){
this.name=name;
this.score=score;
}
public String toString(){
return name+":"+score;
}
}
public class Main {
public static void main(String[] args) {
LinkedList f=new LinkedList();
f.addFirst(new Term("小王", 689));
f.addFirst(new Term("老三",15));
f.addFirst(new Term("Bill",20));
f.addLast(new Term("小王",689));
f.addLast(new Term("老三",15));
f.addLast(new Term("Bill",20));
System.out.println(f);
}
}

B10433022 吳欣芸 提到...

import java.util.*;
class T1{
String name;
int score;
Term(String name, int score){
this.name=name;
this.score=score;
}
public String toString(){
return name+":"+score;
}
}
public class Main {
public static void main(String[] args) {
LinkedList f=new LinkedList();
f.addFirst(new Term("小王", 689));
f.addFirst(new Term("老三",15));
f.addFirst(new Term("Bill",20));
f.addLast(new Term("小王",689));
f.addLast(new Term("老三",15));
f.addLast(new Term("Bill",20));
System.out.println(f);
}
}

B10433040 葉峻宇 提到...

import java.util.*;
class Term{
String name;
int score;
Term(String name, int score){
this.name=name;
this.score=score;
}
public String toString(){
return name+":"+score;
}
}
public class Main {
public static void main(String[] args) {
LinkedList f=new LinkedList();
f.addFirst(new Term("小王", 689));
f.addFirst(new Term("老三",15));
f.addFirst(new Term("Bill",20));
f.addLast(new Term("小王",689));
f.addLast(new Term("老三",15));
f.addLast(new Term("Bill",20));
System.out.println(f);
}
}

b10433049 宋子文 提到...

import java.util.*;
class Term{
String name;
int score;
Term(String name, int score){
this.name=name;
this.score=score;
}
public String toString(){
return name+":"+score;
}
}
public class Main {
public static void main(String[] args) {
LinkedList f=new LinkedList();
f.addFirst(new Term("小王", 689));
f.addFirst(new Term("老三",15));
f.addFirst(new Term("Bill",20));
f.addLast(new Term("小王",689));
f.addLast(new Term("老三",15));
f.addLast(new Term("Bill",20));
System.out.println(f);
}
}

B10433083林綾萱 提到...

import java.util.*;
class Term{
String name;
int score;
Term(String name, int score){
this.name=name;
this.score=score;
}
public String toString(){
return name+":"+score;
}
}
public class Main {
public static void main(String[] args) {
LinkedList f=new LinkedList();
f.addFirst(new Term("小王", 689));
f.addFirst(new Term("老三",15));
f.addFirst(new Term("Bill",20));
f.addLast(new Term("小王",689));
f.addLast(new Term("老三",15));
f.addLast(new Term("Bill",20));
System.out.println(f);
}
}

b10433066劉民崧 提到...

import java.util.*;
class Term{
String name;
int score;
Term(String name, int score){
this.name=name;
this.score=score;
}
public String toString(){
return name+":"+score;
}
}
public class Main {
public static void main(String[] args) {
LinkedList f=new LinkedList();
f.addFirst(new Term("小王", 689));
f.addFirst(new Term("老三",15));
f.addFirst(new Term("Bill",20));
f.addLast(new Term("小王",689));
f.addLast(new Term("老三",15));
f.addLast(new Term("Bill",20));
System.out.println(f);
}
}

B10433066劉民崧 提到...

import java.util.*;
class Term{
String name;
int score;
Term(String name, int score){
this.name=name;
this.score=score;
}
public String toString(){
return name+":"+score;
}
}
public class Main {
public static void main(String[] args) {
LinkedList f=new LinkedList();
f.addFirst(new Term("小王", 689));
f.addFirst(new Term("老三",15));
f.addFirst(new Term("Bill",20));
f.addLast(new Term("小王",689));
f.addLast(new Term("老三",15));
f.addLast(new Term("Bill",20));
System.out.println(f);
}
}

B10433083林綾萱 提到...

import java.util.*;
class Term{
String name;
int score;
Term(String name, int score){
this.name=name;
this.score=score;
}
public String toString(){
return name+":"+score;
}
}
public class Main {
public static void main(String[] args) {
LinkedList f=new LinkedList();
f.addFirst(new Term("小王", 689));
f.addFirst(new Term("老三",15));
f.addFirst(new Term("Bill",20));
f.addLast(new Term("小王",689));
f.addLast(new Term("老三",15));
f.addLast(new Term("Bill",20));
System.out.println(f);
}
}

B10433035 劉軒宇 提到...

import java.util.*;
class Term{
String name;
int score;
Term(String name, int score){
this.name=name;
this.score=score;
}
public String toString(){
return name+":"+score;
}
}
public class Main {
public static void main(String[] args) {
LinkedList f=new LinkedList();
f.addFirst(new Term("小王", 689));
f.addFirst(new Term("老三",15));
f.addFirst(new Term("Bill",20));
f.addLast(new Term("小王",689));
f.addLast(new Term("老三",15));
f.addLast(new Term("Bill",20));
System.out.println(f);
}
}

b10433021呂志信 提到...

mport java.util.LinkedList;
class Term{
String name;
int score;
Term(String name, int score){
this.name=name;
this.score=score;
}
public String toString(){
return name+":"+score;
}
}
public class Main {
public static void main(String[] args) {
LinkedList f=new LinkedList();
f.push(new Term("Bill",20));
f.push(new Term("老三",15));
f.push(new Term("小王", 689));
f.push(new Term("小王", 689));
f.push(new Term("老三",15));
f.push(new Term("Bill",20));
System.out.println(f);
}
}

b10433012 鍾仁凱 提到...

import java.util.*;
class T1{
String name;
int score;
Term(String name, int score){
this.name=name;
this.score=score;
}
public String toString(){
return name+":"+score;
}
}
public class Main {
public static void main(String[] args) {
LinkedList f=new LinkedList();
f.addFirst(new Term("小王", 689));
f.addFirst(new Term("老三",15));
f.addFirst(new Term("Bill",20));
f.addLast(new Term("小王",689));
f.addLast(new Term("老三",15));
f.addLast(new Term("Bill",20));
System.out.println(f);
}
}

B10233187 張郁柔 提到...

import java.util.*;
class Term{
String name;
int score;
Term(String name, int score){
this.name=name;
this.score=score;
}
public String toString(){
return name+":"+score;
}
}
public class Main {
public static void main(String[] args) {
LinkedList f=new LinkedList();
f.addFirst(new Term("小王", 689));
f.addFirst(new Term("老三",15));
f.addFirst(new Term("Bill",20));
f.addLast(new Term("小王",689));
f.addLast(new Term("老三",15));
f.addLast(new Term("Bill",20));
System.out.println(f);
}
}

B10233136 巫駿驛 提到...

import java.util.*;
class Term{
String name;
int score;
Term(String name, int score){
this.name=name;
this.score=score;
}
public String toString(){
return name+":"+score;
}
}
public class Main {
public static void main(String[] args) {
LinkedList f=new LinkedList();
f.addFirst(new Term("小王", 689));
f.addFirst(new Term("老三",15));
f.addFirst(new Term("Bill",20));
f.addLast(new Term("小王",689));
f.addLast(new Term("老三",15));
f.addLast(new Term("Bill",20));
System.out.println(f);
}
}

b10433043彭子豪 提到...

import java.util.LinkedList;
class Term{
String name;
int score;
Term(String name, int score){
this.name=name;
this.score=score;
}
public String toString(){
return name+":"+score;
}
}
public class Main {
public static void main(String[] args) {
LinkedList f=new LinkedList();
f.push(new Term("Bill",20));
f.push(new Term("老三",15));
f.push(new Term("小王", 689));
f.push(new Term("小王", 689));
f.push(new Term("老三",15));
f.push(new Term("Bill",20));
System.out.println(f);
}
}

Related Posts Plugin for WordPress, Blogger...

熱門文章