Class: BinarySearchTreeController

BinarySearchTreeController

Controller for binary search tree.

new BinarySearchTreeController(controlsDiv, treeDiv)

Parameters:
Name Type Description
controlsDiv HTMLDivElement
treeDiv HTMLDivElement
Author:
  • Jakub Melezinek
Source:

Extends

Members

<protected> algorithms :jsgl.util.ArrayList

Type:
  • jsgl.util.ArrayList
Inherited From:
Source:

<protected> controlsDiv :HTMLDivElement

Type:
  • HTMLDivElement
Inherited From:
Source:

<protected> delegatedDisableButtons :Function

Type:
  • Function
Inherited From:
Source:

<protected> delegatedEnableButtons :Function

Type:
  • Function
Inherited From:
Source:

returnedValue :mixed

Type:
  • mixed
Inherited From:
Source:

<protected> treeDiv :HTMLDivElement

Type:
  • HTMLDivElement
Inherited From:
Source:

<protected> visualiser :btv.Visualiser

Type:
Inherited From:
Source:

Methods

<protected> addHistoryOption(algorithm)

Add an option to historySelect.
Parameters:
Name Type Description
algorithm btv.AbstractAlgorithm
Inherited From:
Source:

continuouslyCheckbox()

Add or remove listeners that ensure playing one animation after another.
Inherited From:
Source:

deleteButton()

Source:

<protected> disableButtons()

Disable algorithms buttons and change animation buttons. Used as listener of start of animation.
Inherited From:
Source:

<protected> doAlgorithm(algorithm)

Add an algorithm to algorithms array list, add history option and increase current algorithm index that (re)does the algorithm for the first time and plays the algorithm.
Parameters:
Name Type Description
algorithm btv.AbstractAlgorithm
Inherited From:
Source:

<protected> enableButtons()

Enable algorithms buttons and change animation buttons. Used as listener of end of animation.
Inherited From:
Source:

findButton()

Source:

<protected> getAlgorithmsButtons()

Source:

getMaxButton()

Source:

getMinButton()

Source:

getPredecessorButton()

Source:

getSuccessorButton()

Source:

insertButton()

Source:

<protected> isPlayingSafety()

Skip animation forward if it is playing but it is need to be stopped.
Inherited From:
Source:

moveSpeedButton()

Set new speed of move.
Inherited From:
Source:

pauseButton()

Pauses current visualisation. Change play/pause button.
Inherited From:
Source:

playButton()

Plays current visualisation. Change play/pause button.
Inherited From:
Source:

playPauseButton()

Plays or pause current visualisation depending on state of animation.
Inherited From:
Source:

randomBSTreeButton()

Source:

<protected> redoAlgorithm(algorithm)

Calls undoAlgorithm(returns tree to the state before given algorithm, redraw tree and select right history option) and execute the algorithm again and play the animation.
Parameters:
Name Type Description
algorithm btv.AbstractAlgorithm
Inherited From:
Source:

redoNextButton()

Redo next algorithm and start animation.
Inherited From:
Source:

redoPreviousButton()

Redo previous algorithm and start animation.
Inherited From:
Source:

redoSelectedButton()

Redo algorithm selected from history and start animation.
Inherited From:
Source:

skipBackwardButton()

Skip current visualisation backward.
Inherited From:
Source:

skipForwardButton()

Skip current visualisation forward.
Inherited From:
Source:

stepDurationButton()

Set new duration of a step.
Inherited From:
Source:

toIndexArrayButton()

Source:

toInorderArrayButton()

Source:

toPostorderArrayButton()

Source:

toPreorderArrayButton()

Source:

<protected> undoAlgorithm(algorithm)

Returns tree to the state before given algorithm, redraw tree and select right history option.
Parameters:
Name Type Description
algorithm btv.AbstractAlgorithm
Inherited From:
Source: