2025/04/16 3

Chapter 5: Linked Structures (1)

경희대학교 박제만 교수님의 자료구조 수업을 기반으로 정리한 글입니다.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