GithubHelp home page GithubHelp logo

listtester-1's Introduction

****************
* Project name : Double Linked List
* Class : Computer Science 221
* Date : 06/13/2018
* Your name : Rohit Gangurde
**************** 

OVERVIEW:

 ListTester tests different type of lists to ensure they are implemented correctly, specifically double linked list.


INCLUDED FILES:

 * ListTester.java
 * IUDoubleLinkedList.java
 * IUSingleLinkedList.java
 * IUArrayList.java
 * IndexedUnsortedList.java
 * LinearNode.java
 * README - this file


COMPILING AND RUNNING:

 From the directory containing all source files, compile the
 driver class (and all dependencies) with the command:
 $ javac ListTesteter.java

 Run the compiled class file with the command:
 $ java ListTester

 Console output will give the results after the program finishes. 

PROGRAM DESIGN AND IMPORTANT CONCEPTS:

 ListTester class is designed to test different types of lists. It 
 contains different tests for the methods in the list class. It has
 total of 2629 tests. Concurent Modification is also tested for. The
 double linked list class implements the IndexedUnsortedList interface.
 This means it inherits all the methods of the IndexedUnsortedList
 interface. The double linked list class also extends the LinearNode.java 
 file. Hence, the double linked list uses the concepts of nodes to 
 manipulate the list. It also uses the list iterator to traverse through 
 the class. The list iterator provides an efficient way to deal with 
 problems or scenarios involving indexes. The concept of nodes is way more
 efficient than an array. Nodes work like, insert and pull, to add a new 
 element, you just insert it in there, and to remove an element you just
 pull it out of the list. In an array list, we need to remove the element
 and then shift the elements after that back by one place. Same goes when
 adding an element. This is the perk of double linked list. Perks of using
 an array list is the easy navigation throughout the list. That being said, 
 implementation of list iterator class nullifies this advantage of array lists. 
 ListTester class tests for lists having no element, single element, two element
 and three element. 

TESTING:

 Testing for the class took long. As double linked list enables the user
 user to travel in forward and backward direction throughout the list, 
 I had to be careful when writing the code for this program and not mess
 up the node links, the modCounts. It was more logical testing than trial
 and error.
 I managed to maintain the node links throughout the tests. However I was 
 unable to manage the Concurrent Modification and as such, my doublelinkedlist
 class fails 18 of the concurrent modification tests. 

DISCUSSION:
 
 When working with double linked list, the most trouble I encountered was in
 maintaining the next and previous links for the nodes. This was really tricky 
 as complex scenarios were also involved. I had to check if the previousNode 
 was head or was it tail, if the nextNode was head or tail, if the nextNode is
 null, so and so forth. I tried different methods of adding the elements in,
 such as instead of putting a node with the element in between previousNode 
 and nextNode, I tried swapping the elements of previousNode and the node 
 to be added so that I can put the new node with the element of the previousNode
 before the previousNode and re-establish the links between the node before the 
 previousNode and and the new node. But this created more complications which 
 resulted in me adopting the regular way of adding the elements. 
 The challenging method that I had to deal with was the remove method of the 
 list iterator class. It was challenging as I had to incorporate and think of
 which element would be removed if next was called and which element would be 
 removed if previous was called. What would happen if the element to be removed
 in a node which is head, or tail. Incorporating idea of previous method in 
 coding remove method was tough. With the help of the tutor I was bale to figure
 it out. 
 
EXTRA CREDIT:

 N/A

listtester-1's People

Contributors

rohitgang avatar

Watchers

James Cloos avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.