DCE prac-2
-
Upload
girishbharambe -
Category
Documents
-
view
216 -
download
0
Transcript of DCE prac-2
-
7/23/2019 DCE prac-2
1/3
AIM:
To write a program to perform Shannon-fano algorithm.
Input:-#include
#include
#include
struct node
{char sm!"$%
float pro%
int arr!&$%
int top%
'
s!&$%
tpedef struct node node%
(oid prints)int l*int h*node s!$+
{
int i%for)i,l%i
-
7/23/2019 DCE prac-2
2/3
for)i,l%i1%i--+
pac1&,pac1&s!i$.pro%
diff&,pac1"-pac1&%
if)diff&
-
7/23/2019 DCE prac-2
3/3
{
for)i,%i