Starting from:

$30

CSE225-Project 1 Text Representation with Binary Trees Solved

In text classification studies, textual materials are represented with the frequencies of the words. Suppose that Table 1 gives the frequencies of 50 words in a document.  

 

Table 1. Frequencies of words in the document 

Number 
Word 
Frequency 

people 


country 
10 

city 
15 

news 


population 


society 
28 

university 
35 

sports 
62 

economics 

10 
book 
89 
11 
library 

12 
computer 

13 
mouse 
16 
14 
memory 
27 
15 
game 
50 
16 
student 
60 
17 
club 
70 
18 
text 
83 
19 
algorithm 
46 
20 
compiler 
44 
21 
excel 
49 
22 
name 
51 
23 
department 
56 
24 
head 
54 
25 
faculty 
22 
26 
teacher 
33 
27 
professor 
100 
28 
room 
201 
29 
lab 
92 
30 
kitchen 
94 
31 
clock 
97 
32 
class 
93 
33 
board 
64 
34 
pencil 
65 
35 
window 
61 
36 
team 
19 
37 
software 
13 
38 
group 
14 
39 
grade 
26 
40 
meeting 
88 
41 
bag 
99 
42 
television 
205 
43 
visit 
300 
44 
Ankara 
74 
45 
New York 
77 
46 
Dubai 
76 
47 
plane 
41 
48 
traffic 
42 
49 
car 
43 
50 
bus 
75 
 

 

a)    Build a BST with the key “Word”. 

 

b)    Suppose that the number of accesses to word in your tree is directly the frequency of the word given in the table. 

 

Calculate Total Access Time in the tree you build in (a). 

 

c)     Suppose that the number of accesses to word in your tree is directly the frequency of the word given in the table. Construct a BT to keep these records in the main memory so as to minimize the total access time, where one time unit is the time taken to compare the key of a tree with the key searched!  

 

d)    Calculate Total Access Time in the tree you build in (c). 

 

 

e)    Discuss your results in (b) and (d).  

 

More products