Data Structure Questions/Concepts – Part 2

1. Where is the concept of data structures applied extensively?

2. Minimum number of queues needed to implement the priority queue?
Two. One queue is used for actual storing of data and another for storing priorities. .

Wikipedia says,

A priority queue is an abstract data type in computer programming.

It is exactly like a regular queue or stack data structure, but additionally, each element is associated with a “priority”. stack: elements are pulled in last-in first-out-order (e.g. a stack of papers)
queue: elements are pulled in first-in first-out-order (e.g. a line in a cafeteria)
priority queue: elements are pulled highest-priority-first (e.g. cutting in line, or VIP service).

It is a common misconception that a priority queue is a heap. A priority queue is an abstract concept like “a list” or “a map”; just as a list can be implemented with a linked list or an array, a priority queue can be implemented with a heap or a variety of other methods.

3. Which is the simplest file structure? (a) Sequential (b) Indexed (c) Random
Sequential is the simplest one.

Wikipedia says,

In computer science, sequential access means that a group of elements (e.g. data in a memory array or a disk file or on magnetic tape data storage) is accessed in a predetermined, ordered sequence. Sequential access is sometimes the only way of accessing the data, for example if it is on a tape. It may also be the access method of choice, for example if we simply want to process a sequence of data elements in order.

4. Different Hashing Functions based on the various methods by which the key value is found?


Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

%d bloggers like this: