Sunday, April 5, 2015

How to apply an ADT wisely?

During the last few weeks of the course, I have learnt about several kinds of abstract data structures including Queue, Tree, Binary Tree and Binary Search Tree. This week, I also learnt Linked List. Although it is not so hard to implement these data structures, I always get confused on which data structure to choose in applications.

To solve this problem, I went to a formal CSC148 student and asked for her advice. "Play with them," says she, "It was really cool when you find out it is eligible to link a linked list from the back to the front and create a ring-like list." She also told me that it is very important to understand the properties for each type of data structure. For instance, in BST, the value on the left is always smaller than the node and the value on the right is always bigger. This can be highly efficiency when searching for a typical value in the structure since every time the code makes a comparison, at least half of the useless values are filtered.

So, to choose which data structure to implement, we should understand the usage of the required structure, find out the characteristics of the data, and then choose the right one.

No comments:

Post a Comment