목록All Contents (171)
Code&Data Insights
2022.01.22 Java에서 loop statement인 for/while문은 반복함수를 작성할때 주로 쓰인다. 재귀함수는 자신의 함수 내부에서 자시 자신을 다시 호출하여 문제를 해결한다 => 재귀함수는 문제를 해결해 나가기 위해 원래 범위에서 더 작은 범위의 하위 문제를 먼저 해결함으로써 문제를 해결한다. 더 수학적인 사고방식 * 재귀함수는 더 간결하고 직관적인 풀이 방식이지만, 때로는 심각하게 비효율적이기때문에 알고리즘을 짤때 유의해야한다. * 반복함수를 썼을때보다 훨씬 복잡해서, 더 많은 시간이 걸릴수도 있음 -> 동적 프로그래밍으로 해결 가능

** Big O notation => O(1) : constant time / O(n) : linear time [ Interface vs Data Structure ] Interface : - specification - what data can store - what operations are supported what they mean - problem Data structure: - representation - how to store data - algorithms to support operations - solution 2 main interfaces : set / sequence 2 main Data Structure approaches : arrays / pointer-based * St..

Problem ) Verify that the relation, two ordered pairs(a,b) and (c,d) are equivalent if ad= bc, is an equivalence relation on the set S of all ordered pairs (a, b) of integers with b̸=0. --> (1) reflexive : For all (a, b) ∈ X, ab = ba. This is clearly true. Hence R is reflexive. (2) symmetric : For all (a,b),(c,d) ∈ X, suppose (a,b)R(c,d). Then ad = bc if and only if cb = ..