• 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%
  • 相关阅读:
    使用 asp.net mvc和 jQuery UI 控件包
    ServiceStack.Redis 使用教程
    HTC T8878刷机手册
    Entity Framework CodeFirst 文章汇集
    2011年Mono发展历程
    日志管理实用程序LogExpert
    使用 NuGet 管理项目库
    WCF 4.0路由服务Routing Service
    精进不休 .NET 4.0 (1) asp.net 4.0 新特性之web.config的改进, ViewStateMode, ClientIDMode, EnablePersistedSelection, 控件的其它一些改进
    精进不休 .NET 4.0 (7) ADO.NET Entity Framework 4.0 新特性
  • 原文地址:https://www.cnblogs.com/CS162314/p/7606424.html
Copyright © 2020-2023  润新知