top button
Flag Notify
    Connect to us
      Site Registration

Site Registration

What should be the basis of selecting a data structure for the program?

+3 votes
437 views

Suppose we have the option of selecting Tree, Link list and Hash Table now the question is on what basis we should select each one for our use.

posted Oct 1, 2014 by Tapesh Kulkarni

Share this question
Facebook Share Button Twitter Share Button LinkedIn Share Button

1 Answer

+1 vote

Hash Function- When their is no space complexity, but time complexity is there..

Link list- When you do not have time complexity but space complexity is there. Then it ll be best solution as it can do non contiguous allocations for elements but it takes time to traverse for each kind of operation.

Tree-One reason to use trees might be because you want to store information that naturally forms a hierarchy. For example, the file system on a computer:
As per wiki, following are the common uses of tree.
1. Manipulate hierarchical data.
2. Make information easy to search (see tree traversal).
3. Manipulate sorted lists of data.
4. As a workflow for compositing digital images for visual effects.
5. Router algorithms

answer Oct 1, 2014 by Aarti Jain
...