Sanon Fano Coding
Sanon Fano Coding
// Driver code
int main()
{
int n, i, j;
float total = 0;
string ch;
node temp;
// Input symbols
for (i = 0; i < n; i++) {
cout << "Enter symbol " << i + 1 << " : ";
ch = (char)(65 + i);
cout << ch << endl;
p[i].pro = 1 - total;
Output:
Enter number of symbols : 5
Enter symbol 1 : A
Enter symbol 2 : B
Enter symbol 3 : C
Enter symbol 4 : D
Enter symbol 5 : E