crack
October 17th, 2005, 11:45 AM
I am currently studying a Data Structures & Algorithms subject. The past couple weeks and now i have been studying trees data structure.
I have been assigned to a group for an assignment and it is related to trees.
The assignment requires (as stated on the assignment paper):-
"to write a program to implement a dictionary data structure (i.e. to store words in alphabetical order) using an appropriate dynamic search tree.
Your program must include the following functionalities to enable the user to:
1. insert an element (i.e. word) into the tree
2. delete an element from the tree
3. search for a particular element in the tree
4. display all elements in the tree using an inorder traversal. "
My group is planning on constructing the program using java.
Anyway, as it is during our planning stage, my group must decide on which type of tree structure to use for and as the implementation of the program. At the moment, we are deciding either one between AVL or B-Tree. We choose either of those two since they are what we have been learning up to now. (furthermore, they are the only tree structures that we will learn throught the semester)
As far as i know and what I had learnt, AVL tree is a height balanced tree and it is beneficial where the height difference in an AVL tree is at most is 1 which makes it an efficient and the capability to balance a tree without much hassle. B-tree is more suitable in a larger scope where more values can be added to a node as regard to its tree order and that retrieving a value in a tree can be done fast.
I hope you can give comment on which tree structure is better to use regarding the assignment above. I'm virtually stuck. My gut feeling is to use AVL because I don't think it would a 'big' application to develop where that there would not be plentiful of nodes for the user of the program would need to make use of.
Anyhow, any comments would greatly be appreciated.
Thanks.
I have been assigned to a group for an assignment and it is related to trees.
The assignment requires (as stated on the assignment paper):-
"to write a program to implement a dictionary data structure (i.e. to store words in alphabetical order) using an appropriate dynamic search tree.
Your program must include the following functionalities to enable the user to:
1. insert an element (i.e. word) into the tree
2. delete an element from the tree
3. search for a particular element in the tree
4. display all elements in the tree using an inorder traversal. "
My group is planning on constructing the program using java.
Anyway, as it is during our planning stage, my group must decide on which type of tree structure to use for and as the implementation of the program. At the moment, we are deciding either one between AVL or B-Tree. We choose either of those two since they are what we have been learning up to now. (furthermore, they are the only tree structures that we will learn throught the semester)
As far as i know and what I had learnt, AVL tree is a height balanced tree and it is beneficial where the height difference in an AVL tree is at most is 1 which makes it an efficient and the capability to balance a tree without much hassle. B-tree is more suitable in a larger scope where more values can be added to a node as regard to its tree order and that retrieving a value in a tree can be done fast.
I hope you can give comment on which tree structure is better to use regarding the assignment above. I'm virtually stuck. My gut feeling is to use AVL because I don't think it would a 'big' application to develop where that there would not be plentiful of nodes for the user of the program would need to make use of.
Anyhow, any comments would greatly be appreciated.
Thanks.