Unicode Searching Algorithm Using Multilevel Binary Tree Applied On Bangla Unicode
Unicode Searching Algorithm Using Multilevel Binary Tree Applied On Bangla Unicode
I.
II.
PRELIMINARY STUDIES
INTRODUCTION
named Hasanta (
).
321
T. Sobh (ed.), Innovations and Advanced Techniques in C omputer and Information Sciences and Engineering, 321326.
2007 Springer.
322
322
Fig. 2. Binary Sorted data generated from a simple nondecreasing sorted list.
Fig. 1 (a)
Fig. 1 (b)
Fig. 1 (c)
Fig. 1. Bijoy plain text and its Unicode readable formatted
text showing ASCII and Unicode of corresponding
character.
323
323
324
A. Algorithm
Here first a MLBST_Node class is declared which holds
the elements and links of the node.
The class, MLBST_Node, contains first two variables to
hold searched Unicode data and last three values contains
the MLBST_Node type object indicating the two leafs and
a branch node.
The Buield_MLBST method builds the MLBST
(Multilevel Binary Sorted Tree i.e. in order tree) from the
Multilevel Binary Sorted data.
---------------------------------------------------------------------Declaring MLBST_Node Class
Start:
AsciiCode := 0 as a integer value.
UniCode := Null as a string value.
LeftNode := Null as a MLBST_Node type
RightNode := Null as a MLBST_Node type
BranchNode := Null as a MLBST_Node
type
End:
------------------------------------------------------------------------------------------------------------------------------------------Declaring Buield_MLBST method with Five
Parameters (
Parameter1: Integer array containing the
ASCII codes of a single character (simple/complex).
Patameter2: Integer value containing the
length of the array
Parameter3: Integer value indicating the
point of that array from where the ASCII codes will
be used.
Parameter4: String value containing the
corresponding Unicode.
Parameter5: MLBST_Node type value
indicating the Parent Node.
)
Start:
If the Parameter3 is greater or equal to the
Parameter2 then return TRUE.
If Parameter5 is equal to NULL then
Start:
AsciiCode := value of Paremeter1 at the position of
Parameter3.
If Parameter3 is equal to the Paremeter2 then
Start:
UniCode := value of Parameter4
End:
Create a BranchNode of Parameter5.
Increment Parameter3 by One.
Call Buield_MLBST method with the BranchNode of
Parameter5 and return.
End:
If the value of Parameter1 at the position of
Parameter3 is greater than
324
325
325
B. Search Tree
Let the height of each level tree is h and the MLBST has
n trees. In worst case to search a desired data the
complexity becomes (nh ) .
The best case occurs when the searched data exists in the
root of the first level tree.
Else
Call Search_MLBST method with the LeftNode of
Parameter5 and return.
End:
Else If the value of Parameter1 at the position of
Parameter3 is equal to
AsciiCode of Parameter5 then
Start:
UniCodeTemp := UniCode of Paremeter5.
Increment StartIndex by One.
Increment Parameter3 by One.
Call Search_MLBST method with the BranchNode of
Parameter5 and return.
End:
End:
----------------------------------------------------------------------
MLBST is like the Binary tree so each nod of this tree has
two child nodes (Branch node holds its next level tree so
branch node is not considered). Let the height of each
level tree of the MLBST is h.
So, each level tree holds ( 2 1 ) nodes.
h
Here each node has a branch node that holds the root of its
next level tree. If the MLBST has two level trees then the
h
h
2h
total nodes become ( 2 * 2 = 2 ). Here -1 is omitted
for large value of h.
If MLBST has n level tree then the total nodes will
be 2
A. Build Tree
nh
(2 9 1) * (2 4 1) * (2 3 1) * (2 3 1) .
Omitting -1 the tree building complexity becomes
326
326
V. CONCLUSION
N=
(2 h1 1) * (2 h 2 1) * (2 h3 1) * ... * (2 hn 1)
Here N indicates the total number of nodes and h1 is the
height of first level tree, h2 is the height of the each
second level tree and so on. The equation can also be
represented as,
N=
ACKNOWLEDGEMENT
hb
b=1
C n1
hb ) h a
b=1
a =1
n
n 1
hb ) ( h a + h m )
b=1
REFERENCES
[1]
[2]
http://www.acm.uiuc.edu/conference/index.php
[3]
http://www.jorendorff.com/articles/index.html
[4]
http://www.unicode.org/unicode/reports/tr10/tr108.html
[5]
http://www.connect-bangladesh.org/bangla/
webbangla.html
[6]
http://www.betelco.com/bd/bangla/bangla.html
a =1 m = a +1
n2
n 1
hb ) ( h a + h m + h n )
b =1
+ ...
a =1 m = a +1 n = m +1
n
....
C n1
ha
a =1