20,182,330 2019-2020-1 "Object-oriented programming and data structures" Experiment 7 report

20,182,330 2019-2020-1 "Object-oriented programming and data structures" Experiment 7 report

Course: "Programming and Data Structures"
Class: 1823
Name: Wei Yan ice
Student ID: 20182330
experiments Teacher: Johnny
experiment Date: November 4, 2019
Compulsory / Elective: Compulsory

1. Experimental content

  1. Searching and Sorting define a class, and implements linearSearch, SelectionSort class methods, and finally to complete the test. Test requires less than 10, the design submitted test cases (normal, abnormal, boundary, positive sequence, reverse), the data to be included with the embodiment four after their student number. Figure submit operating results.
  2. Refactor your code. The Sorting.java Searching.java into cn.edu.besti.cs1823 (initials + student number four) packets (eg: cn.edu.besti.cs1823.G2301). Put the test code in the test package. Recompile, run the code, submit to compile, run shots (IDEA, a command line)
  3. Reference http://www.cnblogs.com/maybe2030/p/4715035.html, learn a variety of search algorithm search algorithm in adding Searching and submit the test run results screenshot
  4. Sorting method talked about the realization of supplementary lesson: Hill sort, heap sort, binary tree sorting (at least three). Algorithm (normal, abnormal, boundary) test run results achieved submit screenshots (If you write more than one sort algorithm, even though three of the sort program is defective, you can get out as appropriate)

2. Experimental procedure and results

experiment one

Several tests with Junit follows FIG.


The second experiment

Move files cn.edu.besti.cs1823.G2330 the package and run in a virtual machine file Figure

Third experiment

Supplementary interpolation search, Fibonacci search, the tree table lookup, block search, hash lookup as shown

Experiment 4

Complements Hill sort, heap sort, sort binary tree in Figure

3. Experimental problems encountered in the process and settlement process

  • Question 1: Fibonacci understanding deed find?
  • Problem 1 Solution: Find first start with that deed Fibonacci number column. Fibonacci column from the beginning of paragraph 3, each of which is equal to the sum of the first two. I.e., F (n) = F (n-1) + F (n-2).
  • Fibonacci Find: Find also called the Golden Section. That is, on the basis of binary search is divided according to the Fibonacci columns. In deed Fibonacci number of columns that is equal to slightly greater than the lookup to find a number of elements in the table the number of F [n], the original length of the lookup table extended F. N- , Fibonacci be split is completed, i.e., F [n] th element is divided into the front half F [n-1] element, the latter half of F [n-2] elements, to find to find the element in that part and recursively, until it finds.
  • Question 2: XXXXXX
  • Problem 2 Solution: XXXXXX
  • ...

Other (perception, thinking, etc.)

Finding and sorting personally feel just a bit more difficult to understand, achieve harder. I need to take the initiative to learn, master key method often used a few easy to understand, meet basic needs, learning more on this basis.

Reference material

Guess you like

Origin www.cnblogs.com/weiii/p/11875873.html