파이썬 코드를 작성하던 중 아래와 같은 에러가 발생했다. : TypeError: 'int' object is not subscriptable 위 에러는 배열에 존재하지 하지 않는 구역에 접근하려고 할 때 발생하며, 예시는 아래와같다. arr = [1, 2, [3, 4]] print(arr[0][1]) 실행 결과: TypeError Traceback (most recent call last) in 1 arr = [1, 2, [3, 4]] ----> 2 print(arr[0][1]) TypeError: 'int' object is not subscriptable * subscript: 아래에 기입한, 아래와 적은 문자[숫자, 기호] 참고 - https://en.dict.naver.com/#/entry/enk..
난이도는 Easy로 아래와 같다. Design a logger system that receives a stream of messages along with their timestamps. Each unique message should only be printed at most every 10 seconds (i.e. a message printed at timestamp t will prevent other identical messages from being printed until timestamp t + 10). All messages will come in chronological order. Several messages may arrive at the same timestamp. Imple..
Queue는 대표적인 자료구조(Data Structure)로 일반적으로 First In First Out(FIFO)로 동작한다. (대조되는 자료구조로는 Stack이 있고 Stack은 일반적으로 First In Last Out(FILO)). 담고자 하는 자료형에 따라 Integer, String과 같은 자료형을 함께 선언하면 된다. Java에서 Queue 선언 및 사용은 아래와 같다. import java.util.Queue; import java.util.LinkedList; public class Main { public static void main(String[] args) { Queue iQ = new LinkedList(); Queue sQ = new LinkedList(); iQ.offer(1..
GeeksforGeeks에 따르면 Deque에 대한 설명은 아래와 같다. :Deque (Doubly Ended Queue) in Python is implemented using the module “collections“. Deque is preferred over a list in the cases where we need quicker append and pop operations from both the ends of the container, as deque provides an O(1) time complexity for append and pop operations as compared to a list that provides O(n) time complexity. : "colletions..
![](http://i1.daumcdn.net/thumb/C148x148.fwebp.q85/?fname=https://blog.kakaocdn.net/dn/bj5HH2/btrMOn9h3wL/hCLjKm7rpNFWsXzyWZh351/img.png)
GeeksforGeeks에 따르면 Lowest Common Ancestor(LCA)의 정의는 아래와 같다. : The lowest common ancestor is the lowest node in the tree that has both n1 and n2 as descendants, where n1 and n2 are the nodes for which we wish to find the LCA. Hence, the LCA of a binary tree with nodes n1 and n2 is the shared ancestor of n1 and n2 that is located farthest from the root. : LCA는 트리에서 n1과 n2를 자손(descendants)으로 가지는 가장..
1. 파라미터(매개변수) : 함수(메소드)를 정의할 때 함수명 우측에 추가되는 변수 2. 아규먼트(인자) : 함수(메소드)를 호출할 때 우측에 입력되는 변수 또는 값 3. 예시 : 아래 예시에서 main 함수 내에서 sum() 호출 시 입력된 1, 2는 아규먼트. sum()을 정의할 때 선언된 n1, n2는 파라미터. public static void main(String[] args) { int tot = sum(1, 2); // 1, 2는 아규먼트 System.out.println(tot); } public static int sum(int n1, int n2){ // n1, n2는 파라미터 return n1 + n2; } 실행 결과: 3 출처 1. https://dev-note-97.tistory...
1. 블랙 박스 테스트(외부) : 내부 구조를 참고하지 않고 AUT(Application Under Test)를 테스트 하는 것으로 응용 프로그램(어플리케이션)을 시각화하여 수행한다. 시스템의 내부 구조는 고려하지 않고 응용 프로그램의 기능을 기반으로 테스트 케이스를 도출해 진행한다. - 실행 파일 형태로 테스트 - 의도된 대로 동작하는지 테스트 - 기술적인 지식 불필요 - 화이트 박스 테스트보다 많은 비용 - 내부에 적용된 보안 기술 알 수 없음 - 종류: 동치 분할 검사(Equivalence Partitioning), 경계값 분석(Boundary Value Analysis), 원인-결과 그래프 검사(Cause Effect Graph), 비교 검사, 오류 예측 검사(Error Guessing), 의사 ..
Java에는 C언어와 똑같은 방식으로 전역 변수를 선언할 수 있지만 사용하는 방법은 다르다. Java에서 전역 변수를 개념적으로 이해하기 위해선 Java에는 전역 변수가 없다고 생각하는 것이 편하고, 실제로 자바엔 전역 변수라는 개념이 없다는 설명을 아래와 같이 많이 찾아볼 수 있다. - Truly global variables do not exist in Java - Java actually doesn't have the concept of Global variable - Global variables are not technically allowed in Java C언어의 전역 변수는 아래와 같이 사용이 가능하다. int global_var = 1; int main() { printf("%d", gl..
- Total
- Today
- Yesterday
- C++
- 오블완
- tf-idf
- ml
- 소켓 프로그래밍
- 딕셔너리
- Hash Map
- 머신 러닝
- The Economist
- I2C
- min heap
- 리트코드
- The Economist Espresso
- Python
- socket programming
- defaultdict
- machine learning
- Computer Graphics
- 이코노미스트 에스프레소
- 티스토리챌린지
- leetcode
- 안드로이드
- 투 포인터
- 이코노미스트
- java
- Android
- 파이썬
- DICTIONARY
- vertex shader
- join
일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
1 | ||||||
2 | 3 | 4 | 5 | 6 | 7 | 8 |
9 | 10 | 11 | 12 | 13 | 14 | 15 |
16 | 17 | 18 | 19 | 20 | 21 | 22 |
23 | 24 | 25 | 26 | 27 | 28 |