function ladderizeSubtree(node) {
	if (ladderized !== 'true') {
		node.sort(function(node1, node2) {
			return node1.get_all_leaves().length - node2.get_all_leaves().length
		})
		ladderized = 'true'
	}
	else if (ladderized === 'true') {
		node.sort(function(node1, node2) {
			return node2.get_all_leaves().length - node1.get_all_leaves().length
		})
		ladderized = 'false'
	}
}
/**
 * Ladderizes a specified subtree. If already ladderized, then reverses the direction of ladderization.
 *
 * @param {any} node - The root node of the subtree.
 */
Ladderizes a specified subtree. If already ladderized, then reverses the direction of ladderization.
@param {any} node - The root node of the subtree.
Ladderizes a specified subtree . If already ladderized then reverses the direction of ladderization . @param { any } node - The root node of the subtree .
function ladderizeSubtree(node) {
	if (ladderized !== 'true') {
		node.sort(function(node1, node2) {
			return node1.get_all_leaves().length - node2.get_all_leaves().length
		})
		ladderized = 'true'
	}
	else if (ladderized === 'true') {
		node.sort(function(node1, node2) {
			return node2.get_all_leaves().length - node1.get_all_leaves().length
		})
		ladderized = 'false'
	}
}
function ladderizeSubtree ( node ) { if ( ladderized !== 'true' ) { node . sort ( function ( node1 , node2 ) { return node1 . get_all_leaves ( ) . length - node2 . get_all_leaves ( ) . length } ) ladderized = 'true' } else if ( ladderized === 'true' ) { node . sort ( function ( node1 , node2 ) { return node2 . get_all_leaves ( ) . length - node1 . get_all_leaves ( ) . length } ) ladderized = 'false' } }
Ladderizes a specified subtree.
Ladderizes a specified subtree .