일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
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 |
- 밀라노
- 드롭박스포렌식
- 독일기숙사
- 울름
- 이탈리아
- 애플키노트
- 울름기숙사
- 울름공과대학교
- 교환학생나라
- 이탈리아여행
- 교환학생수업
- 독일교환학생
- 영국
- 교환학생지원
- java
- 기숙사비
- 울름교환학생
- 영국여행
- 교환학생기숙사
- 교환학생
- 프라하여행
- 자바프로그래밍
- 교환학생준비
- 자바
- 디지털포렌식2급
- 밀라노두우모성당
- 디지털포렌식
- 교환학생여행
- 내셔널갤러리
- 드롭박스아티팩트
- Today
- Total
목록Computer Engineering/Algorithms and Data structure (7)
공부해야할 때
![](http://i1.daumcdn.net/thumb/C150x150/?fname=https://blog.kakaocdn.net/dn/c8Lndl/btqvCJmWKfR/wU0Q7nKm1px5A1lb6XBpY0/img.png)
오늘은 Exercise 3에 있는 코딩 문제에 대한 포스팅이다. Exercise 2에는 시간 복잡도를 계산하는 문제가 많았고, 코딩 문제 또한 그전에 구현해놓은 것들을 불러와서 사용하는 게 많았기 때문에 다 스킵을 하였다. 문제부터 다시 보자면 A barcode can be used to uniquely identify products. In the current avariant, a GIN-13 code is applied, where each code number consists of 13 digits 이번 문제는 GTIN-13이란 바코드 번호를 소개하며 고정 13자리의 숫자열에 대해서 강조를 하고 있다. a) The class product is given with attributes for the..
문제를 다시 적어보자면 A method public static TreeSet generateStrings(char [] chSet, int length)is used to generate all possible strings of the given length that can be formed with the characters given in chSet. The same character may be used more than once in a string. You can assume that all entries in chSet are pairwise different. 이번 문제는 예시에서 보여진 대로 문자와 숫자를 입력받고 숫자의 자릿수만큼 문자의 조합을 나타내는 것이다. 예를 들어 A,B,C와..
1.7에 있는 내용은 이렇다 자바의 Standard library 를 사용하지 않고 특정 원소 x가 배열 arr안에 있는지 파악해야 하고 b)에선 재귀를 통하여 ch라는 문자가 arr에 몇번 나오는지를 파악해야한다. 먼저 a)부터 시작하자면 재귀를 통하여 arr이란 배열에서 x를 계속해서 찾아내고 배열의 끝이면 리턴을 하면 된다. public static boolean contains(double x, double[] arr, int endIndex) {if ( endIndex < 0)return false;else if (x == arr[endIndex])return true;else if (x != arr[endIndex])return contains(x,arr,endIndex-1);return fa..
부분집합 구하기 알고리즘은 처음 생각보다 어렵게 끝났던 문제였던거 같다. boolen으로 선언된 allContained(long[] a1, long[] a2) 이란 함수에서 a1이 a2에 부분집합인가를 판별하면 된다. 모두 알겠지만 모든 공집합은 모든 집합의 부분집합이다. (이 간단한 개념이 뒤에서 날 혼란스럽게 했다.) 주어진 문제를 본다면 public static boolean allContained (long[] a1, long[] a2), which checks whether each value that occurs in array a1 is also contained in arraya2. A value can occur more than once in an array. The contents o..
2번째 문제는 Plateau length를 구하는 알고리즘이다. 사실 이 문제는 필수문제는 아니었지만 나의 알고리즘 실력은 아직 부족하여... 연습삼아 하기로 결정했다. 먼저 Plateau를 사전에 검색하면 안정기 또는 정체 상태라는 뜻으로 나온다. 따라서 한 배열에서 연달아 나오는 숫자들중 그 길이가 가장 큰 값을 반환하면 될 것 같다. 먼저 주어진 문제는 다음과 같다. The methodpublic static int maxPlateauLength (int[] a) shall calculate the length of the longest plateau in an array a of ascending ordescending numbers. A plateau is a sub-array containin..
총 9개의 문제중 필수로 해야할 6개중 첫 문제이다. Two strings are anagrams if one string can be formed by reordering the charactersfrom the other. Examples of this are: English: silent / listen German: WIEN / WEINrail safety / fairy tales LAMPE / PALME a) Implement an efficient methodpublic static boolean areAnagrams(String s1, String s2)that checks if the two string s1 and s2 are anagrams. The method should also b..
독일에서 2학기째.. 이번 학기엔 외국학생들을 위한 프로그램이 아닌 실제 독일 학생들과 같이 수업을 듣는 정규프로그램을 신청했다.수업은 영어로 진행되며 독일 학생들과 수업을 같이 듣는 다는 점이 나를 무척 설레게 했다. 이 게시판은 Algorithms and Data Structures(알고리즘과 자료구조) 를 들으면서 수업시간에 다뤘던 예제나 숙제로 나왔던 문제들을 풀이해서 정리하는 게시판이 될 것 같다... 지금 이 글을 쓰는 현재 10월 31일이 마감날인 숙제 하나가 있어서 그 문제부터 차근차근 풀어나갈 예정이당