This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Edge A | Edge B | Edge C | |
---|---|---|---|
39.76 | 52.18 | 64.78 | |
22.48 | 48.65 | 44.65 | |
64.12 | 24.47 | 56.33 | |
49.55 | 79.84 | 84.36 | |
62.41 | 42.53 | 67.90 | |
77.35 | 59.27 | 61.03 | |
48.77 | 61.44 | 23.23 | |
29.16 | 37.16 | 59.92 | |
34.37 | 52.36 | 62.53 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class Stack<T> { | |
public T[] data; | |
public int top; | |
public Stack(Class<T> c, int n) { | |
this.data = (T[]) Array.newInstance(c, n); | |
this.top = 0; | |
} | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class Stack { | |
public Mahasiswa[] data; // tipe data Mahasiswa | |
public int top; | |
public Stack(int n) { | |
this.data = new Mahasiswa[n]; // tipe data Mahasiswa | |
this.top = 0; | |
} | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class Stack { | |
public String[] data; // tipe data String | |
public int top; | |
public Stack(int n) { | |
this.data = new String[n]; // tipe data String | |
this.top = 0; | |
} | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class Stack { | |
public long[] data; // tipe data long | |
public int top; | |
public Stack(int n) { | |
this.data = new long[n]; // tipe data long | |
this.top = 0; | |
} | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class Stack { | |
public int[] data; // tipe data int | |
public int top; | |
public Stack(int n) { | |
this.data = new int[n]; // tipe data int | |
this.top = 0; | |
} | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class Main { | |
public static void main(String[] args) { | |
Stack stack = new Stack(5); | |
stack.push(24); | |
stack.push(9); | |
stack.push(12); | |
System.out.println(stack.pop()); | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class Stack { | |
public int[] data; | |
public int top; | |
public Stack(int n) { | |
this.data = new int[n]; | |
this.top = 0; | |
} | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class Mahasiswa { | |
public String nama; | |
public String nim; | |
public Mahasiswa(String nama, String nim) { | |
this.nama = nama; | |
this.nim = nim; | |
} | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class Main { | |
public static void main(String[] args) { | |
Stack<Mahasiswa> stack = new Stack<>(); | |
stack.push(new Mahasiswa("Andi","123")); | |
stack.push(new Mahasiswa("Budi","234")); | |
System.out.println(stack.pop()); | |
} | |
} |
NewerOlder