Bc150401247 Length: 210 Frequency table: F E

Bc150401247

CS502 assignment#2

We Will Write a Custom Essay Specifically
For You For Only $13.90/page!


order now

Question No#1

Solution:

Sort the activities as per finishing time in
ascending order

Activity

G

D

M

F

B

N

C

L

I

E

O

A

J

K

H

Start
Time

1

1

2

3

4

5

6

4

5

6

7

2

6

7

8

Finish
Time

2

3

3

5

5

6

7

8

8

8

8

9

9

9

9

 

i = finishing time of first activity

j= starting time of the next activity

Selected First Activity

Consequently Starting
time of the next activity j is > = finishing time of first activity

1?2

Preferred activity does
not meet the situation, this activity not selected.

Next selected activity

Thus Starting time of
the next activity j is > = finishing time of first activity

2?3

Determined activity
does not meet the disorder, this activity not selected.

Next selected activity

Therefore Starting time
of the next activity j is > = finishing time of first activity

3?3

Decided on activity
satisfied the condition, this activity is picked.

Next selected activity……………..and so on………

Now activity performed

 

Activity

G

F

N

C

O

H

Start
Time

1

3

5

6

7

8

Finish
Time

2

5

6

7

8

9

 

Question No#2

Solution:

Question#2

Solution:

Alphabets: A, B, C, D, E, F                                      

Total File Length: 210

Frequency
table:

F

E

D

C

B

A

60

50

40

30

20

10

 

 

Letter to be encoded

F

E

D

C

B

A

Frequency

60

50

40

30

20

10

Variable-length code

 10

 01

00

 110

1111

1110

 

 

 

 

 

 

 

 

 

Go Top
x

Hi!
I'm Eleanor!

Would you like to get a custom essay? How about receiving a customized one?

Check it out