일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
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 | 29 | 30 |
31 |
- oracle
- db
- 백준 알고리즘
- SQLite와 Realm 차이점
- Github
- 액티비티 ANR
- 소수
- java
- 알고리즘
- 컬렉션
- support fragment
- android fragment
- anr
- 안드로이드 DBMS
- android adapterview
- 안드로이드 파일
- 자료구조
- 너비우선탐색
- 백준
- support 라이브러리
- 깊이우선탐색
- 자바 컬렉션
- 소수 알고리즘
- application not responding
- 안드로이드
- BFS
- DFS
- android support
- 안드로이드 AdapterView
- 안드로이드 ANR
- Today
- Total
목록분류 전체보기 (48)
밍의 기록들😉
문제 소스코드import java.util.Scanner; public class Tobin { private static int N; private static int K; public static int[] ans = new int[30]; public static void main(String[] args) { Scanner sc = new Scanner(System.in); N = sc.nextInt(); K = sc.nextInt(); tobin(N, K, 0); } // n자릿수 1이 k개인 경우의 수 private static void tobin(int n, int k, int index) { if(N == index){ // 인덱스가 자릿수만큼 채워질 경우 출력 for(int i=0; i0..
문제 소스코드 import java.util.Scanner; public class Division2 { private static int N; private static int cnt = 0; static int[] array = new int[20]; public static void main(String[] args) { Scanner sc = new Scanner(System.in); N = sc.nextInt(); division(N, 0, 0); System.out.println(cnt); } private static void division(int n, int sum, int index) { for(int x=n; x>0; x--){ if(index==0){ // 처음 시작 숫자 array..
스택(Stack)의 개념 한쪽 끝으로만 자료의 삽입, 삭제 작업이 이루어지는 자료 구조 (선형 자료 구조) 가장 나중에 삽입된 자료가 가장 먼저 삭제되는 후입선출(LIFO; Last In First Out) 방식으로 자료를 처리 스택(Stack)의 에러스택 오버플로우 : 스택의 모든 기억장소가 꽉 채워져 있는 상태이므로 더 이상 자료를 삽입할 수 없을 때 발생스택 언더플로우 : 스택에 제거할 자료가 없을 때 발생 스택(Stack)의 연산create(size) : 스택의 크기를 지정하고 생성한다.push(item) : item을 스택에 삽입한다.pop() : 스택에 가장 위에 있는 항목을 제거한다.top() : 스택의 가장 위에 있는 항목을 반환한다.size() : 스택에 있는 item의 개수를 반환한다...
문제 소스코드 import java.util.Arrays; import java.util.Scanner; public class Dangi { public static final int[] dx = {0,0,1,-1}; public static final int[] dy = {1,-1,0,0}; public static void main(String[] args) { Scanner sc = new Scanner(System.in); int n = sc.nextInt(); sc.nextLine(); int[][] a = new int[n][n]; for(int i=0; i
거듭제곱getPower(n, m) = 을 반환하는 함수getPower(n, 0) = 1getPower(n, m) = getPower(n, m-1) x n코드private static int getPower(int n, int m) { if(m==0){ return 1; } else{ return getPower(n, m-1) * n; } }
팩토리얼N! = 1 x 2 x ... x NN! = N x (N-1)!f(n) = n x f(n-1)f(0) = 1귀납적 계산법 코드public int getFactorial(int n){ if(n==0){ return 1; } else return n * getFactorial(n-1); } 순차적 계산법 코드Scanner sc = new Scanner(System.in); int n = sc.nextInt(); int ans = 1; for(int i=2; i
에라토스테네스의 체1부터 N까지 범위 안에 들어가는 모든 소수를 구하기 위해 에라토스테네스의 체를 사용한다.1) 2부터 N까지 모든 수를 쓴다.2) 아직 지워지지 않은 수 중에서 가장 작은 수를 찾는다.3) 그 수는 소수이다.4) 그 수의 배수를 모두 지운다. 코드int n = 100; // 100까지 소수 int[]p = new int[100]; // 소수 저장 int pn = 0; // 소수의 개수 boolean c[] = new boolean[101]; //지워졌으면 true for(int i=2; i
소인수분해정수 N을 소수의 곱으로 분해소수를 구하지 않고 해결 가능N을 소인수분해 했을 때, 나타날 수 있는 인수 중에서 가장 큰 값은 루트 N따라서 2부터 루트 N까지 나눌 수 없을 때까지 계속해서 나누면 됨코드 for(int i=2; i*i1){ System.out.println(n); }
보호되어 있는 글입니다.