Home Class Notes Data Structure and Algorithms Some Important Questions and Answers from Data Structure

Baba

A personal blog of Baba Pandey - A self taught SEO Expert

www.babapandey.com

Interesting Sites:

Computer Forensics Degree


Some Important Questions and Answers from Data Structure PDF Print E-mail
Class Notes and Others - Data Structure and Algorithms

 

 

1. What pointer type is used to implement the heterogeneous linked list in C?

Answer:

Void pointer. The heterogeneous linked list contains different data types in it's nodes and we need a link, pointer, to connect them. Since we can't use ordinary pointers for this, we use the void pointer. Void pointer is a generic pointer type, and capable of storing pointer to any type.

 

2. What is the minimum number of queues needed to implement the priority queue?

Answer:

Two. One queue is used for the actual storing of data, and the other one is used for storing the priorities.

 

3. Which data structure is used to perform recursion?

Answer:

The answer is Stack. Stack has the LIFO (Last In First Out) property; it remembers it's ‘caller’. Therefore, it knows to whom it should return when the function has to return. On the other hand, recursion makes use of the system stack for storing the return addresses of the function calls.
Every recursive function has its equivalent iterative (non-recursive) function. Even when such equivalent iterative procedures are written explicit, stack is to be used.

 

4. What are some of the applications for the tree data structure?

Answer:

1- Manipulation of the arithmetic expressions.
2- Symbol table construction.
3- Syntax analysis.

 

5. Which data strucutres algorithm used in solving the eight Queens problem?

Answer: Backtracking

 

6. In an AVL tree, at what condition the balancing is to be done?

Answer:

If the "pivotal value", or the "height factor", is greater than one or less than minus one.

 

7. What is the bucket size, when the overlapping and collision occur at the same time?

Answer:

The answer is one. If there is only one entry possible in the bucket, when the collision occurs, there is no way to accommodate the colliding value. This results in the overlapping of values.

 

8. There are 8, 15, 13, and 14 nodes in 4 different trees. Which one of them can form a full binary tree?

Answer:

The answer is the tree with 15 nodes. In general, there are 2^n-1 nodes in a full binary tree.
By the method of elimination:
Full binary trees contain odd number of nodes, so there cannot be full binary trees with 8 or 14 nodes. Moreover, with 13 nodes you can form a complete binary tree but not a full binary tree. Thus, the correct answer is 15.

 

Comments (0)
Write comment
Your Contact Details:
Gravatar enabled
Comment:
<strong> <em> <span style="text-decoration:underline;"> <a target=' /> [quote] [code] <img />   
:D:angry::angry-red::evil::idea::love::x:no-comments::ooo::pirate::?::(
:sleep::););)):0
Security
Please input the anti-spam code that you can read in the image.
 

Disclaimer

PS Exam is all about Computer Science and Computer Jobs Exam Preparation, for those who are pursuing Career in Information Technology Field!

 

Our revenue source is advertisements and provide you Free Multiple Choice Questions, Free Quizes, Ebooks and Class Notes, Questions and Answers, Resources to help you prepare better, all for FREE. This site uses Google Adsense and other third party advertisements. The links with double underline are advertisements from Infolinks.

 

Get contents in email instantly

Enter your email address:

 

PS Exam on Facebook

Who's Online

We have 31 guests online

Sponsored