zoukankan      html  css  js  c++  java
  • 20162314 Experiment 1: Linear structure

    Experiment report of Besti

    course:《Program Design & Data Structures》

    Class: 1623

    Student Name: Wang, Yixiao

    Student Number:20162314

    Tutor:Mr.Lou、Mr.Wang

    Experiment date:2017.9.26

    Secret level: Unsecretive

    Experiment time:60 minutes

    Major/Elective:Major

    Experiment order:5

    Experiment content

    1. Linear-list test of Java :Process, Problem.
    1. Linear-list application of Java :Process, Problem.
    1. Implement ArrayList(Pseudocode, Productcode, Testcode): Process(Analysis, Design,implement,test),Problem.
    1. Implement LinkedList (Pseudocode, Productcode, Testcode): Process(Analysis, Design,implement,test),Problem.
    1. Analyze source code of ArrayList and LinkedList:Process,Skill.

    Experiment situation

    Exp1 Linear-list test of Java

    • It's easy to finish this experiment.
    • To start with , import to form a new Linked-list to start the experiment.
    • Next , use the method list.add() to ealuation.
    • Then , use the for-loop to test the Linked-list.add method respectively.
    • Last , export the value of three loops respectively.

    Exp2 Linear-list application of Java

    • To start with , set a class by using List to creat alist and blist, make the two lists' size equally.
    • Next , use the sentence while-if, value alist(i) and blist(j)
    • If the alist(i) > blist(j) , then merge the first place with index i+j by bList.get(j)
    • Else , take the opposite.
    • Then , when the length of alist > i , merge the list with index i+j by alist.get(i)
    • while the length of blist > j , do the opposite
    • After the loops end , return the result of merging lists.
    • Last , write a test with valuing two arraylists by using list.add() and print the result.

    Exp3 Implement ArrayList

    • To start with , import to form a new Array-list to start the experiment.
    • Next , write the index and the first element
    • Next , use the method list.add to make the array list.
    • Then , output and explain the fist element.
    • Then , use the method list.remove to remove a number.
    • Next , use the method list.contain to check whether the number is in list right now.
    • Then , use the for-loop and leam.iterator to print iter.next() .
    • Next , form a new String Array to print string.
    • Then , use the list.clear to clear the list number.
    • Last , use the method list.isEmpty to check whether the list is empty now.

    Exp4 Implement LinkedList

    • The whole test is made of three methods:testLinkedListAPIs(),useLinkedListAsLIFO();,useLinkedListAsFIFO();
    • Then creat a class to explain this three methods.
    • import a new linkedlist
    • Next, use list.add to print
    • Then, use stack to pop and peek.
    • Next, creat a new queue
    • Use the method to add and remove ,last print.

    Exp5 Analyze source code of ArrayList and LinkedList

    >.

    Assume when we creat a Linkedlist at the start, there is only a hearder point,as the following picture.

    There is a elementA1 insert ahead the header.
    Now,insert a element A2 after implementing the code as the following
    Entry newEntry = new Entry(A2, header, header.previous);
    //Make newEntry.next point to the header, new Entry point to header.previous(A1)
    newEntry.previous.next = newEntry;
    newEntry.next.previous = newEntry;
    Then, the picture turn to this

    Code hosting

    PSP5.1(Personal Software Process)

    Steps Time percent
    requirement 45minutes 16.7%
    design 50minutes 18.5%
    coding 1.5hours 32.2%
    test 30minutes 11.1%
    summary 55minutes 19.2%
  • 相关阅读:
    Springboot vue 前后分离 跨域 Activiti6 工作流 集成代码生成器 shiro权限
    mybatis3批量更新 批量插入
    Java GC的工作原理详解
    Hadoop的Map侧join
    cut 命令
    head 与 tail
    常用正则
    vim 设置
    Java泛型初探
    linux修改PS1,自定义命令提示符样式
  • 原文地址:https://www.cnblogs.com/CS162314/p/7606424.html
Copyright © 2011-2022 走看看