visualizeChanges(current, next) {
        var diff = current.difference(next);
        var str = this.determineTheChange(diff);
        var value = str[0];
        var changeObject = JSON.parse(value);
        if (changeObject.hasOwnProperty('pointerIndex') || changeObject.hasOwnProperty('addPointers'))
            this.visualizePointers(current, changeObject);
        else if (changeObject.hasOwnProperty('nodeIndex'))
            this.visualizeLinkedListNodes(current, next, changeObject);
        else if (changeObject.hasOwnProperty('removeNodes')) {
            if (str.length > 1) { //means that there is another change in the list
                for (var i = 1; i < str.length; i++) { //search for a pointer change
                    var anotherValue = str[i];
                    if (anotherValue !== "IGNORE") {
                        var anotherChange = JSON.parse(anotherValue);
                        if (anotherChange.hasOwnProperty('pointerIndex')) { //found
                            this.remove_nodesFromTheList(current, next, changeObject, anotherChange);
                        }
                    } else
                        this.remove_nodesFromTheList(current, next, changeObject, null);
                }
            } else
                this.remove_nodesFromTheList(current, next, changeObject, null);
        } else if (changeObject.hasOwnProperty('addNodes')) {
            if (str.length > 1)
                for (var i = 1; i < str.length; i++) { //search for a pointer change
                    var anotherValue = str[i];
                    var anotherChange = JSON.parse(anotherValue);
                    if (anotherChange.hasOwnProperty('pointerIndex')) { //found
                        this.add_nodesToTheList(current, next, changeObject, anotherChange);
                    }
                }
            else
                this.add_nodesToTheList(current, next, changeObject, null);
        } else
            window.alert("Other Type of Change");

    }
/**
     * Visualize the change from the current step to the next step
     * @param {VisualizationStep} current the current step
     * @param {VisualizationStep} next the next step
     */
Visualize the change from the current step to the next step
@param {VisualizationStep} current the current step
@param {VisualizationStep} next the next step
Visualize the change from the current step to the next step @param { VisualizationStep } current the current step @param { VisualizationStep } next the next step
visualizeChanges(current, next) {
        var diff = current.difference(next);
        var str = this.determineTheChange(diff);
        var value = str[0];
        var changeObject = JSON.parse(value);
        if (changeObject.hasOwnProperty('pointerIndex') || changeObject.hasOwnProperty('addPointers'))
            this.visualizePointers(current, changeObject);
        else if (changeObject.hasOwnProperty('nodeIndex'))
            this.visualizeLinkedListNodes(current, next, changeObject);
        else if (changeObject.hasOwnProperty('removeNodes')) {
            if (str.length > 1) { 
                for (var i = 1; i < str.length; i++) { 
                    var anotherValue = str[i];
                    if (anotherValue !== "IGNORE") {
                        var anotherChange = JSON.parse(anotherValue);
                        if (anotherChange.hasOwnProperty('pointerIndex')) { 
                            this.remove_nodesFromTheList(current, next, changeObject, anotherChange);
                        }
                    } else
                        this.remove_nodesFromTheList(current, next, changeObject, null);
                }
            } else
                this.remove_nodesFromTheList(current, next, changeObject, null);
        } else if (changeObject.hasOwnProperty('addNodes')) {
            if (str.length > 1)
                for (var i = 1; i < str.length; i++) { 
                    var anotherValue = str[i];
                    var anotherChange = JSON.parse(anotherValue);
                    if (anotherChange.hasOwnProperty('pointerIndex')) { 
                        this.add_nodesToTheList(current, next, changeObject, anotherChange);
                    }
                }
            else
                this.add_nodesToTheList(current, next, changeObject, null);
        } else
            window.alert("Other Type of Change");
    }
visualizeChanges ( current , next ) { var diff = current . difference ( next ) ; var str = this . determineTheChange ( diff ) ; var value = str [ 0 ] ; var changeObject = JSON . parse ( value ) ; if ( changeObject . hasOwnProperty ( 'pointerIndex' ) || changeObject . hasOwnProperty ( 'addPointers' ) ) this . visualizePointers ( current , changeObject ) ; else if ( changeObject . hasOwnProperty ( 'nodeIndex' ) ) this . visualizeLinkedListNodes ( current , next , changeObject ) ; else if ( changeObject . hasOwnProperty ( 'removeNodes' ) ) { if ( str . length > 1 ) { for ( var i = 1 ; i < str . length ; i ++ ) { var anotherValue = str [ i ] ; if ( anotherValue !== "IGNORE" ) { var anotherChange = JSON . parse ( anotherValue ) ; if ( anotherChange . hasOwnProperty ( 'pointerIndex' ) ) { this . remove_nodesFromTheList ( current , next , changeObject , anotherChange ) ; } } else this . remove_nodesFromTheList ( current , next , changeObject , null ) ; } } else this . remove_nodesFromTheList ( current , next , changeObject , null ) ; } else if ( changeObject . hasOwnProperty ( 'addNodes' ) ) { if ( str . length > 1 ) for ( var i = 1 ; i < str . length ; i ++ ) { var anotherValue = str [ i ] ; var anotherChange = JSON . parse ( anotherValue ) ; if ( anotherChange . hasOwnProperty ( 'pointerIndex' ) ) { this . add_nodesToTheList ( current , next , changeObject , anotherChange ) ; } } else this . add_nodesToTheList ( current , next , changeObject , null ) ; } else window . alert ( "Other Type of Change" ) ; }
Visualize the change from the current step to the next step
 @param {VisualizationStep} current the current step
 @param {VisualizationStep} next the next step
Visualize the change from the current step to the next step @param { VisualizationStep } current the current step @param { VisualizationStep } next the next step
//means that there is another change in the list //search for a pointer change //found //search for a pointer change //found