Professional Documents
Culture Documents
Datastructures For Language Processing
Datastructures For Language Processing
Processing
G F
H
B F
D
Linear Nonlinear
Search and Allocation datastructure
Search datastructures are used during
language processing to maintain attribute
information concerning different entities in the
source program.
The attribute entry for an entity is created only
once but may be searched for a large no of
times.So search efficiency is important.
Allocation datastructures are characterized by
the fact that the address of the memory area
allocated to an entity is known to the users of
that entity.
No search operations are conducted on
them.Speed of allocation or deallocation and
efficiency of memory utilization are the
important criteria.
Life time of datastructures.
tables.
Allocation datastructures are used to handle
programs with nested structures of some kind.
Target program rarely uses search datastrctures,
1 2 3 4 5 6 7 8 9 10
1 2 3
#f
#n
a 5
b 6
c 7
d 8
In the previous example, entries 5 to 8 form a
cluster of size 4.
So now any symbol x such that h(x)=5 suffers
4 collisions due to the cluster.
The average number of collitions for a colliding
entry = 1/2 X(average size of cluster +1)