/*Generates a new bst with the random vertices created by the previous method*/ private void btnGenRan_Click(object sender, EventArgs e) { BST_visualizer newBstVis = new BST_visualizer(); lblInfo.Text = "Done!"; newBstVis.createSearchTree(generateRandomNodesList()); newBstVis.Show(); previousForm.Hide(); this.Close(); }
/*Verifies the given data and then deletes(or not) a set of specified nodes*/ private void iconBtnDeleteNode_Click(object sender, EventArgs e) { BST_visualizer newBst = new BST_visualizer(); if (verifyData()) { newBst.createNewSearchTree(deleteAndUpdateCurrent(nodesToDeleteList)); previous.Hide(); newBst.Show(); this.Close(); } }
/*Creates(or not) a bst after making the necessary validations when the user clicks on the 'generate' button*/ private void btnDone_Click(object sender, EventArgs e) { if (string.IsNullOrEmpty(inputNumbers.Text.ToString())) { lblInfo.Text = "You haven't entered any numbers yet."; } else if (commaAmmountVerifier() && !otherVerifiers() && numberAmmountVerifier()) { BST_visualizer newBstVis = new BST_visualizer(); lblInfo.Text = "Done!"; newBstVis.createSearchTree(numberArray); newBstVis.changeTitleText(); newBstVis.Show(); previousForm.Hide(); this.Close(); } else { lblInfo.Text = "Please verify the data you are trying to submit."; ammountOfNumbers = 0; commaCounter = 0; } }