전체 글 56

Programming Exercise: Lab #4

경희대학교 박제만 교수님의 자료구조 수업을 기반으로 정리한 글입니다.Exercise #1ProblemsImplement linked structure STACK.~StackType(): destructorsize(): returns the length of stackpush(): pushes a new item into the stackpop(): pops and returns the item at the top of stack (if the stack is empty, return -1)StackType::~StackType(){ NodeType* tempPtr = topPtr; while (tempPtr != nullptr) { topPtr = topPtr->next; ..

CS/자료구조 2025.04.19

Chapter 5: Linked Structures

경희대학교 박제만 교수님의 자료구조 수업을 기반으로 정리한 글입니다.Linked Structure Array-based Stack Implementation▶ In the previous implementation, we consider an entire stack (a set of items) as a single object (array). New stack Implementation▶ Here, we consider each item in the stack a single object (Node).How could we define relationships between items? (Who's on top of whom?)Node Implementation▶ A pointer can be used..

CS/자료구조 2025.04.16

Programming Exercise: Lab #3

경희대학교 박제만 교수님의 자료구조 수업을 기반으로 정리한 글입니다.Exercise #1ProblemsImplement rotateFirstItem() in Circular Queue with Reserved space.This function "ROTATES" the first item of the queue.▶ Both are OKAY (in-place or not)! HINT: It is allowed to call "other member functions" inside a member function.e.g., enqueue(), dequeue(), isEmpty(), etc.)templatevoid QueueType::rotateFirstItem(){ if(isEmpty()){ ..

CS/자료구조 2025.04.16

Chapter 4.5: Programming Tips

경희대학교 박제만 교수님의 자료구조 수업을 기반으로 정리한 글입니다.Call by X▶ Swap Example (1) - call by valueswap1_a = 3swap1_b = 5▶ Looking into 'Swap1'▶ Swap Example (2) - call by referenceswap2_a = 5swap2_b = 3▶ Swap Example (3) - call by pointer(address)swap3_a = 5 swap3_b = 3▶ Swap Example (4)swap1_a = 3swap1_b = 5 C/C++ Basics:it is almost about "copy" How C/C++ Deals with Variables: Copy▶ copyWe learned it as "inser..

CS/자료구조 2025.04.16

Programming Exercise: Lab #2

경희대학교 박제만 교수님의 자료구조 수업을 기반으로 정리한 글입니다.Exercise #1ProblemsImplement (1) BinarySearch(int item) and (2) BinarySearchNearest(int item).Assume that there are No duplicated elements in the list.▶ (1) BinarySearch(int item) is the function we already learned in the class.The only difference is that "it returns the index of the item" if foundOtherwise, it returns -1template int SortedType::BinarySearch..

CS/자료구조 2025.04.06

XSS game

경희대학교 중앙동아리 쿠러그의 정보보안 강의를 기반으로 정리한 글입니다.XSS gameXSS game은 XSS 공격을 통해 다음과 같이 alert()를 띄우는 게임이다.Level 1: Hello, world of XSS해당 창에 "hi"라고 입력하면,다음과 같이 "hi"가 그대로 뜨는 것을 확인할 수 있다. 주어진 Target code에서 해당 페이지를 보여주는 부분을 찾아보면,message = "Sorry, no results were found for " + query + "." 해당 코드를 찾을 수 있다.이 코드를 보면 입력한 대로 query로 들어간다. 때문에, 아래와 같이 입력을 넣어주면 alert()를 띄울 수 있다. Level 2: Persistence is keyLevel 1을 풀었던 방식..

Chapter 4: Queue

경희대학교 박제만 교수님의 자료구조 수업을 기반으로 정리한 글입니다.QueueWhat is Queue?▶ Logical (or ADT) level Queue is an ordered group of homogeneous items (elements).New elements are added at one end (the rear) -- enqueue.Elements are removed from the other end (the front) -- dequeue. A queue is a FIFO "First In, First Out" structure. (선입선출)e.g., Job buffers, Network buffers, and many others (일을 순서대로 처리해야 되는 모든 상황) ※ buf..

CS/자료구조 2025.03.31

정보보안 3차시: 웹 - SQL Injection

경희대학교 중앙동아리 쿠러그의 정보보안 강의를 기반으로 정리한 글입니다.배경 지식DB (Database)여러 사람이 공유하여 사용할 목적으로 구조화된 정보 또는 데이터의 조직화된 모음집이다.대부분은 여러 개의 표가 모여 있다. (마치 엑셀 시트처럼) DBMS (Database Management Systme)데이터베이스를 '데이터의 집합'이라고 정의한다면, 이런 데이터베이스를 관리하고 운영하는 소프트웨어를 DBMS라고 한다.다양한 데이터가 저장되어 있는 데이터베이스에 여러 명의 사용자나 응용 프로그램이 공유하고 동시에 접근이 가능하게 한다.ex) MySQL, Oracle, MariaDBSQL (Structured Query Language)구조화된 질의 언어라는 뜻으로, 데이터를 쿼리 조작 및 정의하고 ..

Chapter 3: Stack

경희대학교 박제만 교수님의 자료구조 수업을 기반으로 정리한 글입니다.StackWhat is Stack?▶ Logical (or ADT) level Stack is a group of homogeneous items (elements).Removal (pop) and addition (push) of stack items can only occur at the top of the stack. A stack is a LIFO "Last In, First Out" structure.e.g., Undo(무효로 하다, Ctrl + z), Back (browser 뒤로가기), Stack trace ※ stack trace: 프로그램에서 에러가 발생했을 때, 문제를 추적할 수 있도록 함수 호출 순서를 보여주는 로그이..

CS/자료구조 2025.03.28

정보보안 2차시: 웹 - 기본적인 웹 취약점

경희대학교 중앙동아리 쿠러그의 정보보안 강의를 기반으로 정리한 글입니다.웹 해킹해킹이란 개발자가 의도하지 않은 동작을 입력 혹은 행위를 통해 악의적인 결과를 만들어내는 것을 말하며,웹 해킹은 클라이언트와 웹 서버 간의 요청과 응답 흐름에서 발생한다.클라이언트 / 서버▶ 클라이언트 / 서버 클라이언트브라우저서버라는 다른 컴퓨터에 접속할 수 있는 응용프로그램이나 서비스웹페이지에서 하는 요청은 대부분 웹브라우저가 함 (웹에서 클라이언트는 브라우저)HTML, JS, CSS 등웹페이지를 요청해서 CSS와 같은 요소에 연결해서 홈페이지가 그려짐브라우저의 위치도 내 컴퓨터이기에, 코드들의 실행 위치도 내 컴퓨터 안에 있음페이지를 전송받으면 인터프리터를 통해 페이지를 화면에 뿌림서버 사이드웹서버, 데이터베이스클라이언트..