미국유학/Data Structure and Algorithm (14) 썸네일형 리스트형 Binary Search Tree (BSTNode) class BinarySearchTree { /** An inner class representing a node in a BST tree */ private class BSTNode { int data; // value at the node BSTNode left; // left child BSTNode right; // right child BSTNode(int newdata) { data = newdata; } } // end of class BSTNode private BSTNode root; // the root of the tree /** * Constructor */ .. 2월6일 DSA Queue 구현 (Stack으로) Queue구현(LinkedList으로) Binary Search Tree -> 시간복잡도 logn일 수도 있지만 불균형 트리면 n까지 될수도 있음 2월4일, DSA Stack implementation : LinkedList push pop 그래서 stack의 top을 head에 넣으면은, pop도 constant time 필요 Queue -enqueue : constant time -deque : constant time Queue with array -잘 모르겟음.. (gpt)📌 배열 기반 Queue에서 나머지를 사용하는 이유 (Circular Queue)배열(Array)로 Queue를 구현할 때, 나머지 연산 (%)을 사용하여 원형 큐 (Circular Queue)를 만드는 이유를 설명할게.✅ 1. 기본적인 배열 기반 큐 (문제점)배열을 사용해서 큐를 구현할 때, front와 rear라는 두 개의 인덱스를 사용.. Jan 31 Friday 2025 package linkedlists;import javax.swing.text.html.HTMLDocument;import java.util.Iterator;public class LinkedList implements Iterable { private Node head, tail; public LinkedList() { head = null; tail = null; } public void append(int elem) { Node newNode = new Node(elem); // FILL IN CODE if (head == null){ head = tail = newNode; }else{ .. 1.28 화요일 Linkedlist -stores what's next (but not store previous one) Insert at the Tail *print할 때 새로 객체 만들어서 해줘야 원래 자료가 안바뀜 Insert at the Head *바꿔주는거다 setNext()로 1/23(목) , 1/24 (금) 이전 1 2 다음