2010년 4월 15일 목요일
Data Structure 6번째 HW(번역)
6주차 선형 목록 : 포인터 시뮬레이트 표현법.
Since we have midterm exams next week, I will give you an extremely easy assignment. I belive that this takes only a couple of hours.
다음주에 시험이니까 매우쉬운 과제를 줄께, 난 이 과제가 2시간 정도 걸릴거라고 생각해.
Section 7.7 introduces the concepts of the equivalent relationship and union set.
7.7장에서 동등관계와 공용체의 컨셉을 소개했다.
Just type in the example code to find the union set, and write a program that test the example code.
책에서 공용체를 찾는 코드를 그대로 쳐라, 그리고 그것을 테스트하는 예제 코드를 만들어 보아라.
What you will turn in is a PDF file that contains the test code, screen shots of the test program in execution, and brief explanation of your understanding on the concepts of the equivalent relationship and union set.
니가 할일은 테스트 코드와, 실행 스크린샷, 그리고 니가 이 컨셉을 이해했다는것을 증명하는 설명을 PDF에 담아 제출하는것이다.
Data Structure 6번째 HW
Week 6: Linear Lists - Simulated Pointer Representation
Section 7.7 introduces the concepts of the equivalent relationship and union set. Just type in the example code to find the union set, and write a program that test the example code. What you will turn in is a PDF file that contains the test code, screen shots of the test program in execution, and brief explanation of your understanding on the concepts of the equivalent relationship and union set.
2010년 4월 10일 토요일
Data Structure 5번째 HW(내맘대로 분석)
Week 5: Linear Lists - Linked Representation
1. Write code for the class ChainWithSortMethods.
ChainWithSortMethods 클래스를 만들어라
This class is a subclass of Chain and it includes the number method insertionSort, which uses insertion sort to reorder the chain elements into nondecreasing order.
이 클래스는 Chain을 상속받는다. 그리고 인자의 크기를 오름차순 정렬하는 insertionSort 메소드를 갖고있다.
=========================================================
위 두가지의 조건에 맞추려면 Chain은 그냥 저자 홈페이지에서 갖고오고, 나머지는 그냥 쓰면 되겠다.
Do not create new nodes or delete old ones.
노드를 새로 생성하거나 삭제하지 마라.
=========================================================
헐,,, 이건 좀 문제다,,,,, 링크만 수정하는 방식으로 가야겠네,,,
a) What is the worst-case time complexity of your method? How much time does your method need if the elements are already in sorted order?
최악의 경우 에 시간복잡도는 얼마인가?
이미 정리되어 있는 경우에는 시간이 얼마나 걸리는가?
b) Test the correctness of your method by compiling and then executing the code. Use your own test data (any programs with any data are allowed).
측정의 정확성을 위해 컴파일링을 하고 실행해봐라.
너만의 테스트 데이터를 만들어라
Data Structure 5번째 HW(번역)
Week 5: Linear Lists - Linked Representation
1. Write code for the class ChainWithSortMethods.
ChainWithSortMethods 클래스를 만들어라
This class is a subclass of Chain and it includes the number method insertionSort, which uses insertion sort to reorder the chain elements into nondecreasing order.
이 클래스는 Chain을 상속받는다. 그리고 인자의 크기를 오름차순 정렬하는 insertionSort 메소드를 갖고있다.
Do not create new nodes or delete old ones.
노드를 새로 생성하거나 삭제하지 마라.
a) What is the worst-case time complexity of your method? How much time does your method need if the elements are already in sorted order?
최악의 경우 에 시간복잡도는 얼마인가?
이미 정리되어 있는 경우에는 시간이 얼마나 걸리는가?
b) Test the correctness of your method by compiling and then executing the code. Use your own test data (any programs with any data are allowed).
측정의 정확성을 위해 컴파일링을 하고 실행해봐라.
너만의 테스트 데이터를 만들어라
Data Structure 5번째 HW
Week 5: Linear Lists - Linked Representation
1. Write code for the class ChainWithSortMethods. This class is a subclass of Chain and it includes the number method insertionSort, which uses insertion sort to reorder the chain elements into nondecreasing order. Do not create new nodes or delete old ones.
a) What is the worst-case time complexity of your method? How much time does your method need if the elements are already in sorted order?
b) Test the correctness of your method by compiling and then executing the code. Use your own test data (any programs with any data are allowed).
2010년 4월 1일 목요일
Data Structure 4번째 HW(번역)
프로그램 5.1 에 있는것과 같이 StucentLinearList 인터페이스를 만들어라.
Implement the “StudentArrayLinearList” class, which is an implementation of the interface “StudentLinearList”.
StudentLinearList를 인터페이스로 갖는, StucentArrayLinearList클래스를 구현하여라.
Modify the time measuring program, which was used in the last homework, by replacing the “Student” object array with the “StudentArrayList” class.
지난번 과제에서 만들어 놓은 시간측정프로그램을 Student배열을 사용하던것에서 StudentArrayList클래스를 사용하는것으로 수정해라.
2. Extend “StudentArrayLinearList” to include the method “removeRange”, which removes all elements in the specified index range.
StudentArrayLinearList를 특정 인덱스 범위를 제거하는 removeRange메소드를 갖도록 확장해라.
What is the complexity of your method?
이 메소드의 복잡도는 얼마인가?
3. Extend “StudentArrayLinearList” to include the method “concateList”, which concatenates a parameter “StudentArrayLinearList” to the list of the method-owner object.
StudentArrayLinearList를 StudentArrayLinearList를 인자로 하여, 원래 배열에 인자로 받은 배열을 이어 붙이는 concateList메소드를 갖도록 확장해라.
What is the complexity of your method? Test your code with a simple example code.
Data Structure 4번째 HW
2. Extend “StudentArrayLinearList” to include the method “removeRange”, which removes all elements in the specified index range. What is the complexity of your method?
3. Extend “StudentArrayLinearList” to include the method “concateList”, which concatenates a parameter “StudentArrayLinearList” to the list of the method-owner object. What is the complexity of your method? Test your code with a simple example code.