반응형

전체 글 106

LeetCode - median of two sorted arrays

Median of Two Sorted Arrays - LeetCode Level up your coding skills and quickly land a job. This is the best place to expand your knowledge and get prepared for your next interview. leetcode.com 나의 풀이 - 실패 떠올린 방식 1. 하나의 배열에 모두 넣고 binary search - time complexity : O(n log n) - 문제의 시간 복잡도 제한 조건을 만족하지 못하는 풀이 2. lowerBound를 이용해서 해당 수보다 작거나 같은 수를 찾아서 각각 확인하는 방식 - time complexity : O(log (n + m)) - 배열의..

Leet Code - Longest Substring Without Repeating Characters

Longest Substring Without Repeating Characters - LeetCode Level up your coding skills and quickly land a job. This is the best place to expand your knowledge and get prepared for your next interview. leetcode.com 나의 풀이 class Solution { public int lengthOfLongestSubstring(String s) { int len = s.length(); Map map = new HashMap(); int maxLen = 0; int curLen = 0; for (int i = 0; i < len; i++) { if ..

Lecture 05: Machine-Level Programming 1: Basics

History of Intel processors and architectures Intel x86 Processors Complex instruction set computer (CISC) Many different instructions with many different formats Hard to match performance of Reduced Instruction Set Computers (RISC) 2015 State of the Art Core i7 Broadwell 2015 DDR : DRAM (메인 메모리)로 이어진다 PCI : Peripheral Devices로 이어진다 SATA : 여러 디스크로 이어진다 Ethernet : 네트워크로 이어진다 Our Coverage IA32 The..

Lecture 04: Floating Point

K Fractional Binary Numbers Representable Numbers Limitation 1 - Can only exactly represent numbers of the form x / 2^k - 다른 숫자들은 무한 소수가 된다 Limitation 2 - Just one setting of binary point within the w bits - 소수점을 왼쪽으로 옮기면 큰 수를 나타낼 수 없고, 오른쪽으로 옮기면 소수점 자리를 자세하게 나타내지 못한다 Floating Point Representation Precision Options Normalized Values When : exp != 0000...0 and exp != 1111...1 Normalized Encoding ..

Lecture 03: Bits, Bytes, and Integers (cont.)

Unsigned Addition in C Operands : w bits True Sum : w + 1 bits Discard Carry : w bits 따라서 Unsigned int 두 수의 합은 (실제 두 수의 합 mod 2^w) 의 값과 같다 Two's Complement Addition 두 수의 합에서 discard를 하더라도 실제 값과 동일한 경우가 존재한다 두 음수의 합에서 negative overflow가 발생하기도 한다 두 양수의 합에서 positive overflow가 발생하기도 한다 Unsigned Multiplication in C Operands : w bits True product : 2 * w bits Discard w bits : w bits 따라서 Unsigned int 두..

Lecture 02: Bits, Bytes, and Integers

비트는 특정 구간대의 전기 신호만 해당 신호로 받아들이고 0.2V ~ 0.9V 사이의 전압은 신호로 받아들이지 않아서 노이즈 등에 영향을 받지 않을 수 있다. binary에서 쓰이는 소수점은 decimal에서의 소수점과 다르다. 1.20 (10진법) 에서 소수 첫째 자리는 1 / 10을 의미 1.20 (2진법) 에서 소수 첫째 자리는 1 / 2을 의미 아래 도표 익숙해지기 bit 및 bit 연산을 이용해서 Set를 표현하고 조작할 수 있다. (비트 마스킹과 유사한 방식) File I/O (C library) 에서 시스템에 어떤 파일들이 input으로 주어질 수 있는지를 판단할 때도 흔히 사용되는 방식 Logical Operations in C &&, ||, ! 연산자는 항상 0이나 1만 반환한다 0은 "..

Lecture 01: Course Overview

Jim Tobin 교수의 15-213 Introduction to Computer Systems 강의를 들을 계획입니다. 1강에서는 해당 강의에서 다룰 내용들과 목표 등에 대한 소개를 해주셨습니다. 간략히 강의 개요를 살펴보자면 아래와 같습니다. 1. Programs and Data 2. Memory Hierarchy 3. Exceptional Control Flow 4. Virtual Memory 5. Networking and Concurrency 각각의 챕터에서 어떤 것을 배우게 되는지에 대해서 자세하게 알려주셨습니다. 또한 강의 내내 총 7개의 흥미로운 과제가 주어집니다. 1. L1 (datalab) : Manipulating bits 조건문이나 반복문 없이 입력한 수의 절대값을 반환하는 등의 간..

반응형