Student ID 20182335 2019-2020-1 "Object-oriented programming and data structures" sixth experiment report

Course: "Programming and Data Structures"
Class: 1823
Name: Li Jinquan
Student ID: 20182335
experiments Teacher: Johnny
experiment Date: October 2019 Day
Compulsory / Elective: Compulsory

1. Experimental content

1. list practice required to achieve the following functions:

Some integer input via the keyboard, the establishment of a list;

The number is your student number in sequence out of double digits. Coupled with today's time.

For example, your student number is 20172301

Today, time is 2018/10/1, 16:23:49 seconds

The figure is
20, 17,23,1, 20, 18,10,1,16,23,49
print all the elements of the list, and the total number of elements of the output.

In your program, please use a special variable name to record the total number of elements, the variable name is your name. For example, you called Zhang Third, then the variable name is
int nZhangSan = 0; // initialized to zero.

This step is done, your program checked into source control (git push).

2. list practice required to achieve the following functions:

Achieved node insertion, deletion, output operation;

You continue on a program to expand its functionality, each finished a new feature, or written more than 10 lines of new code, you check in code committed to the source server;

Read a file from disk, this file has two numbers.

Digital read from a file 1, bit 5 is inserted into the list, and the total number of digital printing, and elements. Keep this list, proceed to the next operation.

Digital read from the file 2 is inserted into the list of 0, and the total number of printed numbers, and elements.
Keep this list, and proceed to the next operation.
Just delete numbers from the list and print the total number 1. All figures and elements.

3. list practice required to achieve the following functions:

Using bubble sort or selection to sort the list are ordered according to numerical values;
if you learn number is odd, selecting bubble sort, selection sort or selection.

In each round of sorting, the total number of print elements, and all elements of the current list.

Continue to expand in the program (2) obtained with the same program file, write different functions to achieve this function. Still with nZhangSan (your name) to represent the total number of elements.

4. The realization of experiments (1) and (2) in the android

The implementation of experiment (3) on the platform android

2. Experimental procedure and results

Experiment 6 (1)

Experiment 6 (2)

Experiment 6 (3)

Experiment 6 (4)

Experiment 6 (5)

3. Experimental problems encountered in the process and settlement process

  • Question 1: Algorithm performs the sorting process required to print elements, the method using array.toString will be abnormal, in particular garbled, or partially toString method does not show anything
    problems Solution 1: choose another output, such as

for(int num:arr){

      System.out.print(num+" ");

    }

String str = "";

            for (int x = 0; x < size(); x++){

                str += array[x]+ " ";

            }

Such an output would be no problem.

Question 2: the last bubble sort, from small to large order has been lined up, but sorting operation is still going on

Problem 2 Solution: On the surface order has already lined up, but double loop operation also needs to be continued, the computer can not directly identify this string of numbers, can only be completed in accordance with established operations, as long as the number is less than the maximum sort ( digital descending order in ascending order of the number of bubble sort through the turns) is correct.

Other (perception, thinking, etc.)

I'm still not enough understanding of the course of the experiment and master, especially in the debugging process has many steps do not know the specific meaning, the need to consult and learn from the students. The future will continue to work hard to understand each step.

## References
"Java programming and data structures Course (Second Edition)"

"Java programming and data structures Course (Second Edition)" Study Guide
android menu font too small
Unable to resolve dependency for ': app @ debug / compileClasspath': Could not resolv ... [ultimate solution]

About Android Studio interface in the Design Layout manually adjusted the layout after running in the simulator is not the same solution

Guess you like

Origin www.cnblogs.com/lijinquan/p/11768526.html