본문 바로가기
반응형

Fundamental3

큐 Queue(kotlin Implementation ),코틀린 구현 FIFO First in first out 놀이 공원 매표소와 같이 큐에 저장되는 순서대로 제거되는 자료구조 AddItem - Add item을 리스트 끝부분에 추가 Remove - 리스트의 첫번째 항목 제거 Peek - 가장 위에 항목 반환 Isempty - 큐 비어있을대 true 반환 활용도 bfs 사용 LinkedList를 이용하는 Queue예 val names: Queue = LinkedList() names.add("Jack") names.add("Adam") names.add("Katherin") names.add("Helen") names.add("Watson") println(names) 2021. 11. 1.
스택 Stack (kotlin Implementation ),코틀린 구현 스택(stack)은 제한적으로 접근할 수 있는 나열 구조이다. 그 접근 방법은 언제나 목록의 끝에서만 일어난다. 끝먼저내기 목록(Pushdown list)이라고도 한다. 스택은 한 쪽 끝에서만 자료를 넣거나 뺄 수 있는 선형 구조(LIFO - Last In First Out)으로 되어 있다. 자료를 넣는 것을 '밀어넣는다' 하여 푸쉬(push)라고 하고 반대로 넣어둔 자료를 꺼내는 것을 팝(pop)이라고 하는데, 이때 꺼내지는 자료는 가장 최근에 푸쉬한 자료부터 나오게 된다. 이처럼 나중에 넣은 값이 먼저 나오는 것을 LIFO 구조라고 한다 Kotlin Implmentaion class MutableStack(vararg items: E) { // 1 private val elements = items... 2021. 10. 31.
HTTP basic concepts Networking Terms Data: (Usually in the raw form) anything that is sent over the network. Client: Server: HTTP: Hypertext Transfer Protocol HTTPS: HTTP Secure, Requests and Responses A HTTP response consists of a body and a status code. Body: Content of a response (such as the HTML that makes up a webpage Status code: 3 digit number signaling the type of response (success, failure, etc.) HTTP Ver.. 2020. 12. 6.
반응형