본문 바로가기

TechInterview

(80)
Arithmetic of complex number(1) multiply example code, 복소수 사칙연산(1) 곱셈 코드, real/imaginary, java, opencv, matrix (1) Arithmetic of complex number(1) multiply example code, 복소수 사칙연산(1) 곱셈 코드, real/imaginary, java, opencv, matrix (1) 공식은..Formula.. i^2 = -1, (a + bi) * (c + di) -> (ac - bd) + (ad + bc)i 나눗셈은 아래에Division formula is below 2018/11/26 - [Programming/Java] - Arithmetic of complex number(2) division example code, 복소수 사칙연산(2) 나눗셈 코드, real/imaginary, java, opencv, matrix (2) Lemme see code.. 코드를 보자.. 예제..
Java foreach statement (advanced for iteration statement) 자바 향상된 for문 문법 Java foreach statement (advanced for iteration statement) 자바 향상된 for문 문법 Main function process //Process//1. Make new integer list for sample//2. Iterate using normal for statement (printout)//3. Iterate using foreach statement (printout)//4. Finish //처리과정//1. 확인할 샘플 정수리스트를 만든다.//2. 일반 for문을 사용하여 출력해본다.//3. foreach문을 사용하여 출력해본다.//4. 끝낸다. Example code below public class TestForeach { public stati..
Visual Studio console closing problem after running main function 비주얼스튜디오 메인 실행 후 콘솔 꺼지는 문제 Visual Studio console closing after running main function 비주얼스튜디오 메인 실행 후 콘솔 꺼지는 문제 메인함수를 콘솔에서 확인하려고 실행시 (e.g. Hello world)동작이 끝난 후 아무키나 누르세요... 에서 멈추지 않고 바로 콘솔이 꺼지는 경우 When you wanna check main function on console (e.g. hello world)It's not stop after finishing function. Check after changing properties in each project 프로젝트마다 속성 설정을 바꿔주고 확인 Debug (menu) -> Properties (project) -> Linker -> Syste..
Aracade Intro #32 absoluteValuesSumMinimization. Algorithm, 알고리즘, Codefights, CodeSignal, 코드파이트, 코드시그널, 예제, example, c++ java c# scalar Aracade Intro #32 absoluteValuesSumMinimization. Algorithm, 알고리즘, Codefights, CodeSignal, 코드파이트, 코드시그널, 예제, example, c++ java c# scalar Q. Given a sorted array of integers a, find an integer x from a such that the value of abs(a[0] - x) + abs(a[1] - x) + ... + abs(a[a.length - 1] - x) is the smallest possible (here abs denotes the absolute value).If there are several possible answers, output the..
Aracade Intro #31 depositProfit. Algorithm, 알고리즘, Codefights, CodeSignal, 코드파이트, 코드시그널, 예제, example, c++ java c# scalar Aracade Intro #31 depositProfit. Algorithm, 알고리즘, Codefights, CodeSignal, 코드파이트, 코드시그널, 예제, example, c++ java c# scalar Q. You have deposited a specific amount of money into your bank account. Each year your balance increases at the same growth rate. With the assumption that you don't make any additional deposits, find out how long it would take for your balance to pass a specific threshold. Of ..
Aracade Intro #30 circleOfNumbers. Algorithm, 알고리즘, Codefights, CodeSignal, 코드파이트, 코드시그널, 예제, example, c++ java c# scalar Aracade Intro #30 circleOfNumbers. Algorithm, 알고리즘, Codefights, CodeSignal, 코드파이트, 코드시그널, 예제, example, c++ java c# scalar Q. Consider integer numbers from 0 to n - 1 written down along the circle in such a way that the distance between any two neighboring numbers is equal (note that 0 and n - 1 are neighboring, too). Given n and firstNumber, find the number which is written in the radially oppos..
How to initialize vector in C++ STL (Standard Template Library), STL 벡터 초기화 방법 How to initialize vector in C++ STL (Standard Template Library), STL 벡터 초기화 방법 제일 간단한 3가지만Simplest way to initialize vector in c++ 1 - 벡터를 만들면서 즉시 값을 넣어서 초기화 2 - 벡터를 만들어두고 넣고 싶은 값을 넣어서 초기화 3 - 넣을 배열이 있다면, 벡터를 만들며 배열을 옮겨 넣으며 초기화 // 1 - Initialize when you make vector 2 - Initialize after making vector 3 - Initialize when you make vector using array you made before it int main(int argc, char*(*arg..
Aracade Intro #29 chessBoardCellColor. Algorithm, 알고리즘, Codefights, CodeSignal, 코드파이트, 코드시그널, 예제, example, c++ java c# scalar Aracade Intro #29 chessBoardCellColor. Algorithm, 알고리즘, Codefights, CodeSignal, 코드파이트, 코드시그널, 예제, example, c++ java c# scalar Q. Given two cells on the standard chess board, determine whether they have the same color or not. 체스판에서 주어진 두개의 셀이, 같은 색깔인지 아닌지 확인하라. e.g. For cell1 = "A1" and cell2 = "C3", the output should bechessBoardCellColor(cell1, cell2) = true. For cell1 = "A1" and cell2 = "H3", ..