분류 전체보기853 Double Linked List package review1; public class DoubleLinkedList { public Node1 head = null; public Node1 tail = null; //데이터 추가 public void addNode(T data){ if(this.head == null){ this.head = new Node1 (data); this.tail = this.head; }else{ Node1 node = this.head; while(node.next != null){ node = node.next; } node.next = new Node1(data); node.next.prev = node; this.tail = node.next; } } public void printAll(){ if(.. 2021. 7. 14. ArrayList package review1; import java.util.ArrayList; import java.util.Collections; public class ArrayList02 { /*ArrayList의 접근 시간은 LinkedList에 비해 빠르다. 하지만 LinkedList에 비해 ArrayList는 데이터의 추가/삭제가 느리다. 순차적인 추가 삭제는 더 빠르다. (데이터들의 주소가 붙어있기 때문에) 비효율적인 메모리를 사용해야 한다.*/ public static void main(String[] args) { ArrayList data_list = new ArrayList(); //데이터 추가 data_list.add(3); System.out.println(data_list); //[3] dat.. 2021. 7. 14. 백준 1152 import java.io.BufferedReader; import java.io.IOException; import java.io.InputStreamReader; public class Main1152 { public static void main(String[] args) throws IOException { BufferedReader bf = new BufferedReader(new InputStreamReader(System.in)); String s = bf.readLine().trim(); int cnt = 0; for(int i=0; i 2021. 7. 14. 백준 1157 import java.io.BufferedReader; import java.io.IOException; import java.io.InputStreamReader; public class Main1157 { public static void main(String[] args) throws IOException { BufferedReader bf = new BufferedReader(new InputStreamReader(System.in)); String arr = bf.readLine(); int[] history = new int[26]; int max = 0; int cnt = 0; char result = 0; for (int i = 0; i < arr.length(); i++) { if (is.. 2021. 7. 14. 백준 2675 import java.util.Scanner; public class Main2675 { public static void main(String[] args) { Scanner s = new Scanner(System.in); int T = s.nextInt(); String[] S = new String[T]; String[] P = new String[T]; for(int i=0; i 2021. 7. 14. 프림 알고리즘(Prim Path)-(1) 보호되어 있는 글 입니다. 2021. 7. 14. 이전 1 ··· 115 116 117 118 119 120 121 ··· 143 다음