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 6번째 HW(번역)  (0) 2010.04.15
Data Structure 6번째 HW  (0) 2010.04.15
Data Structure 5번째 HW(번역)  (0) 2010.04.10
Data Structure 5번째 HW  (0) 2010.04.10
Data Structure 4번째 HW(번역)  (0) 2010.04.01