Basic CS-Data Structures [3i Infotech Placement]: Sample Questions 43 - 45 of 52

Glide to success with Doorsteptutor material for competitive exams : get questions, notes, tests, video lectures and more- for all subjects of your exam.

Question 43

Data Structures

Question

MCQ▾

In tree construction which is the suitable efficient data structure?

Choices

Choice (4)

a.

Queue

b.

Linked list

c.

Stack

d.

Array

Answer

b.

Explanation

Defination of Link List
  • A linked list is a sequence of data structures connected to each other via links.
  • Linked list is a sequence of links which contains items.
  • Each link contains a connection to another link.
  • The second most-used data structure after array.

Important terms to understand the concept of Linked List:

  • Link
    • Every link of a linked list stores a data called an element
  • Next
    • Every link of a linked list contains a link to the next link called next.
  • Linked List
    • Contains connection link to the first link called first.
The Concept of Linked List

Question 44

Data Structures
Edit

Write in Short

Short Answer▾

What is Minimum number of queues needed to implement the priority queue?

Explanation

  • 2 queues would be needed.
  • One queue stores the data and creates one more queue.
  • The second queue stores the priority in place of data- priority the program would check and process.

Question 45

Data Structures
Edit

Describe in Detail

Essay▾

Does the minimum spanning tree of a graph give the shortest distance between any 2 specified nodes?

Explanation

Understanding Minimum Spanning Tree
  • No, the minimum spanning tree is not guaranteed to give the shortest distance between any 2 specified nodes.
  • By definition the min spanning tree doesn՚t have redundant connections and hence no shortcuts which the full graph might have.

Minimum spanning Tree:

  • A subset of the edges of a connected graph.
  • A graph can have many spanning trees.
  • Minimum spanning tree is the spanning tree where the cost is minimum among all the spanning trees- with cost defined as weight of vertices
  • Graph can have many minimum spanning trees.
  • Direct application in the design of networks.
  • Used in algorithms-
    • Approximating the travelling salesman problem
    • Multi-terminal minimum cut problem
    • Minimum-cost weighted perfect matching

Developed by: