i need that code which enable me only to show that possible paths between number of N numbers / nodes as a permutation andcombination,
only the ListBox code
..............................
thatis for permutation Button solving :
private void Btn_Permutation_Solve_Click(object sender, EventArgs e)
{
long n = 0, r = 0;
long result;
try
{
n = long.Parse(Txt_Permutation_Source.Text);
}
catch (FormatException)
{
MessageBox.Show("Invalid Number");
}
try
{
r = long.Parse(Txt_Permutation_Destination.Text);
result = Operations_Class.Permutation(n, r);
Txt_Permutation_Result.Text = result.ToString();
}
catch (FormatException)
{
MessageBox.Show("Invalid Number");
}
--------------------------------
and that's for combination Button solving :
private void Btn_Combination_Solve_Click(object sender, EventArgs e)
{
long n = 0, r = 0;
long result ;
try
{
- n = long.Parse(Txt_Combination_Source.Text);
}
catch (FormatException)
{
MessageBox.Show("Invalid Number");
}
try
{
r = long.Parse(Txt_Combination_Destination.Text);
result = Operations_Class.Combination(n, r);
Txt_Combination_Result.Text = result.ToString();
}
catch (FormatException)
{
MessageBox.Show("Invalid Number");
}
string JoinedLetters = Txt_Combination_Source.Text;
List<char> SplitLetters = JoinedLetters.ToList();
int WordLength = SplitLetters.Count;
int[] Number = new int[WordLength];
listBox1.DataSource = null;
listBox1.Items.Clear();
listBox1.Refresh();
results = new List<string>();
for (int Comb = 1; Comb <= WordLength; Comb++)
{
pCombinations = pCombinations * Comb;
}
string word = "";
count = 0;
permutations(WordLength, SplitLetters, word);
listBox2.DataSource = results;
progressBar1.Value = (int)(((count - 1) / pCombinations) * 100);
}
--------------------------------------
but to show all of the operations happening before calculating the permutation and combination in a listbox, we have to edit that code under the comment
"//---------ListBox"
so what can i can do to perform that, your response already will be appreciated