분류 전체보기

    Vector with python 01

    Vector with python 01

    -Each element can be accessed using index. same as normal array Can edit elements by using index. -Can assignment - 배정,배치 -Can copying... using copy method "copy()" In this case, copy address value. -Vector Equality : "==" operateor checks whether the two vectors (operand) are the same or not. And return boolean value. On NUMPY : "==" on numpy arrays perform element-wise comparison. -Be careful ..

    Vector notation & operations & my proof

    Vector notation & operations & my proof

    Vector is: an ordered finite list of numbers Each Elements called elements / entries... *Unit vectors When you proof something about vector, you should check dimension first and then element-wise. Remeber how to proof Commutative / Associative / Left and Right distrubutive Also Remeber rotation "+" is different compared to calculation rotation "+". The former is VECTOR Addition. New Topic : Line..

    [2월 18일] Selection Sort Algorithm 삽입정렬, Insertion Sort Algorithm 삽입정렬

    [2월 18일] Selection Sort Algorithm 삽입정렬, Insertion Sort Algorithm 삽입정렬

    *참고 영상 : https://youtu.be/GUDLRan2DWM #1 Selection Sort 선택정렬 1. Scan the whole array to find the minimum 2. Instead of filling 1 in 0th index on array B, SWAP with the 0th index. Because that's where 1 belongs, it belongs to 0th index. 3. Look for the next minimum, 1 need NOT to be considered. Scan index 1 to 5th. *The array is divided into 2 parts sorted or else. And we need to do (n-2) passes...

    [2월 5일] 버블정렬 알고리즘, 문자수만큼 회전하기

    #문자수만큼 오른쪽으로 한바퀴 회전하여 출력하는 프로그램 한 글자를 임시 변수에 저장해두고 제쳐둔다음, 나머지 글자를 하나씩 밀어주기(=회전시키기) 여기서 중요한건.. tmp라는 변수에 문자를 저장하는 것임. //문자수만큼 오른쪽으로 한바퀴 회전하여 출력하는 프로그램 //길이 구하는 함수 int whatLen(char* snt) { int len = 0; for (int i = 0; snt[i] != '\0'; i++) //표현 기억해두기. len++; return len; } void move(char* snt, char tmp) { int len = whatLen(snt); for (int i = 0; i < len; i++) { /*임시변수 tmp에 가장 끝 글자 저장하고, 끝에서부터 한칸씩 밀어준..

    [1월 15일] 선택정렬 & 문자열 카운트,문자 포함 여부,단어 개수,상수,StringTokenizer,StringBuilder

    1. 선택정렬 (오름차순) *내림차순도 같은 원리임. 부등호 방향만 반대로 해주면 된다. package algorithm; import java.util.Scanner; public class Selection_sort001 { /* 가장 큰 수를 잡아 제일 끝 A[last]로 보내고 배열 A의 두번째 인덱스까지 오게 하는 것이다. 생각해줘야하는 배열 크기가 점점 줄어든다. */ public static void swap(int a[], int x, int y) { int tmp = a[x]; a[x] = a[y]; a[y] = tmp; } public static void selection_sort(int a[], int N, int K) { for(int i = N - 1; i > 0; i--) { ..

    [1월 11일] 숫자 각 자릿수 활용

    1. 백준 1065 - 한수 -각 자릿수 구하는 방법 백의 자리 = num / 100 십의 자리 = (num / 10) % 10 일의 자리 = num % 10 Java - 212ms import java.util.Scanner; public class b1065 { public static boolean isSeq(int num) { int first = num / 100; int mid = (num / 10) % 10; int last = num % 10; if ((first - mid) == (mid - last)) return true; return false; } public static int counting(int num) { int count = 0; if (num < 100) return ..