MOOC/CS102 Introduction of CS2 10

Unit 7. quick sort + binary tree using python

파이썬으로 직접 구현한 quick sort와 binary tree 입니다. 아래 문서에서 Integer Overflow, exception 등이 재밌어 구현해봤습니다. 문서 출처는 MIT, Saylor.org 입니다. 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263import random # use a mid point pivot# recursion# O(n log n)def quickSort(List): # base case if len(List) pivot: more.append(el) elif el

Unit 5. Assessment Review

5장의 평가 문제에서는 Recursion의 구조, 불변 데이터와 Recursion을 왜 사용하는지에 대해 피드백합니다. Q4. List the two ways in which recursion is used in Computer Science. Recursion is used in Computer Science to both describe a problem(that is, the requirements) and to design a solution to that problem(D & C) Q5. A recursive function defined in two parts. Name the two parts. The two parts are the base case(s) and the recursive s..

Unit 5.1.2 John Guttag's "Recursion Lecture Notes"

재귀에 대한 모든 것을 맛볼 수 있는 John Guttag 교수님의 "Recursion Lecture Note"를 리뷰합니다. Recursion Implementation Topic 1. reetrant code2. recursion vs iteration3. relation of recursion to the functional and imperative programming paradigm4. common mistakes in programming recursion Structure of Recursive Implementation 1. base case 2. recursive step Q. Recursive methods have a base case and recursive step what ot..

Unit 4. Assesment Review

4장의 평가 문제를 피드백하겠습니다. 예외 처리가 발생하는 이유, Assertion에 대해 정리합니다. Q1. Explain what an exception is and what happens when one occurs. An exception is an interruption of the execution of a program. This can be caused by a hardware failure, a software error, or human intervention. When an exception or interrupt occurs, the runtime system (the hardware and software that manage the execution of programs) tra..

Unit 3. Assessment Review

Unit 3의 평가 문제를 피드백하겠습니다. Unit 3는 STL에 관련된 것들을 묻는 문제들이 나왔습니다. Q2. Write a simple statement that explains a generic unit. A generic unit is code that defines a computation in which the types and operations are not specified until the code is used. Q4. Match each concept with the associated itemModularity : Expressions, Statements, and functionAbstraction : Naming compound elements as a unitComposi..

Unit 3. STL Main Design Idea

Basics of Information Encoding Impacts design- Mechanism (devices, # of components used)- Efficiency (bits used)- Reliability (immunity to noise)- Security (encryption) Huffman's Algorithm 압축 단위마다 문자의 출현 빈도를 조사하여 빈도가 높은 순서대로 비트 수가 적은 부호를 부여함으로써 데이터를 압축하는 방식이다. https://www.youtube.com/watch?v=CvfifZsmpQ4&feature=youtu.be : Basics of Information review : concepts / features of OOP1. Modularity 2. ..

Unit 2. Assessment Review

Unit 2의 평가 문제를 피드백하겠습니다. Unit 2는 프로그래밍 컨셉, oop를 묻는 내용이 주를 이뤘습니다. Q1. Describe the programming process The programming process is an ordered list of steps or stages that is performed to produce a program. Understand the task or problem to be performed or solvedDetermine a high level strategy for performing the task or solving the problemElaborate the high level strategy to a detailed strategy tha..

Unit 2. The Building Blocks of Object-Oriented Programming

본 포스팅은 자바의 객체 지향 프로그래밍에 대한 기초적인 내용을 담고 있습니다. 그림 1. JVM Memory Layout 고전적 computer science의 언어 중 하나인 자바를 처음 사용할 시에 제가 느꼈던 장애 요소가 2가지 정도 존재했습니다. 첫 번째 , new의 키워드 의미를 정확하게 이해하지 못했습니다. 객체를 생성하는 것은 알겠는데, 그게 어떤 방식으로 생성되는지 알지 못했었습니다. 두 번째, 알아야되는 용어가 많아서 흐릿한 배경 지식을 가지고 코딩을 하였습니다. polymorphism, Inheritance, encapsulation, class variable, instance variable, subclass, super class, garbage collector 등이 내포한 의..