visualizeLinkedListNodes(current, next, changeObject) {
        if (changeObject.hasOwnProperty('data')) { //change of node data values
            var nodeIndex = changeObject.nodeIndex;
            var newData = changeObject.To;
            this.visualizer.umsg("Change the value of node number " + nodeIndex + " From: " + this.JsavLinkedList.get(nodeIndex).value() + " To: " + newData);
            this.JsavLinkedList.get(nodeIndex).value(newData);
        } else if (changeObject.hasOwnProperty('next')) {
            //first check if the node is part of the list or not
            var partOfTheList = false;
            var nodeIndex = changeObject.nodeIndex;
            var node = current.getLinkedListForStep().getNode(nodeIndex);
            for (var i = 0; i < current.getLinkedListForStep().size(); i++) {
                var listNode = current.getLinkedListForStep().getNode(i);
                if (listNode.getNext() !== null && listNode.getNext().toString() === node.getReference())
                    partOfTheList = true;
            }
            if (!partOfTheList) {
                var newNode = this.JsavLinkedList.getNodeNotPartOfTheListByData(current.getLinkedListForStep().getNode(nodeIndex).getData());
                var nextIndex = current.getLinkedListForStep().getNodeLocation(changeObject.To.toString());
                if (nextIndex == 0) { //add the new node at first
                    this.JsavLinkedList.addFirst(newNode, current.getLinkedListForStep().getNode(nodeIndex).getReference());
                    this.JsavLinkedList.layout();
                    this.visualizer.umsg("add the node with value " + current.getLinkedListForStep().getNode(nodeIndex).getData() + " at the first position in the list");
                    //correct all lists as the 
                } else
                    newNode.next(this.JsavLinkedList.get(nextIndex));

            } else if (!current.getLinkedListForStep().isCircular() && next.getLinkedListForStep().isCircular()) //make the linked list circular
            {
                this.JsavLinkedList.circular = true;
                this.JsavLinkedList.layout(changeObject.To.toString());
                this.visualizer.umsg("set the next link for the node with value " + current.getLinkedListForStep().getNode(changeObject.nodeIndex).getData() + " to the node with value " +
                    next.getLinkedListForStep().getNodeByReference(changeObject.To).getData());
            } else if (current.getLinkedListForStep().isCircular() && !next.getLinkedListForStep().isCircular()) { //remove the circular edge
                //implement me
                window.alert("implement Me");
            } else if (changeObject.To === null) { //remove the next link
                var jsavNode = this.JsavLinkedList.get(changeObject.nodeIndex);
                jsavNode.next(null);
                jsavNode.edgeToNext().hide();
                this.visualizer.umsg("set the next link for the node with value " + current.getLinkedListForStep().getNode(changeObject.nodeIndex).getData() + " to null");
            }
        }
    }
/**
     * Visualizes the change in the order of nodes (next values), or the values of nodes
     * @param {VisualizationStep} current the current visualization step
     * @param {VisualizationStep} next the next visualization step
     * @param {Hash} changeObject Hash table that contains the changes to be applied on list nodes
     */
Visualizes the change in the order of nodes (next values), or the values of nodes
@param {VisualizationStep} current the current visualization step
@param {VisualizationStep} next the next visualization step
@param {Hash} changeObject Hash table that contains the changes to be applied on list nodes
Visualizes the change in the order of nodes ( next values ) or the values of nodes @param { VisualizationStep } current the current visualization step @param { VisualizationStep } next the next visualization step @param { Hash } changeObject Hash table that contains the changes to be applied on list nodes
visualizeLinkedListNodes(current, next, changeObject) {
        if (changeObject.hasOwnProperty('data')) { 
            var nodeIndex = changeObject.nodeIndex;
            var newData = changeObject.To;
            this.visualizer.umsg("Change the value of node number " + nodeIndex + " From: " + this.JsavLinkedList.get(nodeIndex).value() + " To: " + newData);
            this.JsavLinkedList.get(nodeIndex).value(newData);
        } else if (changeObject.hasOwnProperty('next')) {
            var partOfTheList = false;
            var nodeIndex = changeObject.nodeIndex;
            var node = current.getLinkedListForStep().getNode(nodeIndex);
            for (var i = 0; i < current.getLinkedListForStep().size(); i++) {
                var listNode = current.getLinkedListForStep().getNode(i);
                if (listNode.getNext() !== null && listNode.getNext().toString() === node.getReference())
                    partOfTheList = true;
            }
            if (!partOfTheList) {
                var newNode = this.JsavLinkedList.getNodeNotPartOfTheListByData(current.getLinkedListForStep().getNode(nodeIndex).getData());
                var nextIndex = current.getLinkedListForStep().getNodeLocation(changeObject.To.toString());
                if (nextIndex == 0) { 
                    this.JsavLinkedList.addFirst(newNode, current.getLinkedListForStep().getNode(nodeIndex).getReference());
                    this.JsavLinkedList.layout();
                    this.visualizer.umsg("add the node with value " + current.getLinkedListForStep().getNode(nodeIndex).getData() + " at the first position in the list");
                } else
                    newNode.next(this.JsavLinkedList.get(nextIndex));
            } else if (!current.getLinkedListForStep().isCircular() && next.getLinkedListForStep().isCircular()) 
            {
                this.JsavLinkedList.circular = true;
                this.JsavLinkedList.layout(changeObject.To.toString());
                this.visualizer.umsg("set the next link for the node with value " + current.getLinkedListForStep().getNode(changeObject.nodeIndex).getData() + " to the node with value " +
                    next.getLinkedListForStep().getNodeByReference(changeObject.To).getData());
            } else if (current.getLinkedListForStep().isCircular() && !next.getLinkedListForStep().isCircular()) { 
                window.alert("implement Me");
            } else if (changeObject.To === null) { 
                var jsavNode = this.JsavLinkedList.get(changeObject.nodeIndex);
                jsavNode.next(null);
                jsavNode.edgeToNext().hide();
                this.visualizer.umsg("set the next link for the node with value " + current.getLinkedListForStep().getNode(changeObject.nodeIndex).getData() + " to null");
            }
        }
    }
visualizeLinkedListNodes ( current , next , changeObject ) { if ( changeObject . hasOwnProperty ( 'data' ) ) { var nodeIndex = changeObject . nodeIndex ; var newData = changeObject . To ; this . visualizer . umsg ( "Change the value of node number " + nodeIndex + " From: " + this . JsavLinkedList . get ( nodeIndex ) . value ( ) + " To: " + newData ) ; this . JsavLinkedList . get ( nodeIndex ) . value ( newData ) ; } else if ( changeObject . hasOwnProperty ( 'next' ) ) { var partOfTheList = false ; var nodeIndex = changeObject . nodeIndex ; var node = current . getLinkedListForStep ( ) . getNode ( nodeIndex ) ; for ( var i = 0 ; i < current . getLinkedListForStep ( ) . size ( ) ; i ++ ) { var listNode = current . getLinkedListForStep ( ) . getNode ( i ) ; if ( listNode . getNext ( ) !== null && listNode . getNext ( ) . toString ( ) === node . getReference ( ) ) partOfTheList = true ; } if ( ! partOfTheList ) { var newNode = this . JsavLinkedList . getNodeNotPartOfTheListByData ( current . getLinkedListForStep ( ) . getNode ( nodeIndex ) . getData ( ) ) ; var nextIndex = current . getLinkedListForStep ( ) . getNodeLocation ( changeObject . To . toString ( ) ) ; if ( nextIndex == 0 ) { this . JsavLinkedList . addFirst ( newNode , current . getLinkedListForStep ( ) . getNode ( nodeIndex ) . getReference ( ) ) ; this . JsavLinkedList . layout ( ) ; this . visualizer . umsg ( "add the node with value " + current . getLinkedListForStep ( ) . getNode ( nodeIndex ) . getData ( ) + " at the first position in the list" ) ; } else newNode . next ( this . JsavLinkedList . get ( nextIndex ) ) ; } else if ( ! current . getLinkedListForStep ( ) . isCircular ( ) && next . getLinkedListForStep ( ) . isCircular ( ) ) { this . JsavLinkedList . circular = true ; this . JsavLinkedList . layout ( changeObject . To . toString ( ) ) ; this . visualizer . umsg ( "set the next link for the node with value " + current . getLinkedListForStep ( ) . getNode ( changeObject . nodeIndex ) . getData ( ) + " to the node with value " + next . getLinkedListForStep ( ) . getNodeByReference ( changeObject . To ) . getData ( ) ) ; } else if ( current . getLinkedListForStep ( ) . isCircular ( ) && ! next . getLinkedListForStep ( ) . isCircular ( ) ) { window . alert ( "implement Me" ) ; } else if ( changeObject . To === null ) { var jsavNode = this . JsavLinkedList . get ( changeObject . nodeIndex ) ; jsavNode . next ( null ) ; jsavNode . edgeToNext ( ) . hide ( ) ; this . visualizer . umsg ( "set the next link for the node with value " + current . getLinkedListForStep ( ) . getNode ( changeObject . nodeIndex ) . getData ( ) + " to null" ) ; } } }
Visualizes the change in the order of nodes (next values), or the values of nodes
 @param {VisualizationStep} current the current visualization step
 @param {VisualizationStep} next the next visualization step
 @param {Hash} changeObject Hash table that contains the changes to be applied on list nodes
Visualizes the change in the order of nodes ( next values ) or the values of nodes @param { VisualizationStep } current the current visualization step @param { VisualizationStep } next the next visualization step @param { Hash } changeObject Hash table that contains the changes to be applied on list nodes
//change of node data values //first check if the node is part of the list or not //add the new node at first //correct all lists as the  //make the linked list circular //remove the circular edge //implement me //remove the next link