Basic CS-Data Structures [3i Infotech Placement]: Sample Questions 13 - 14 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 13

Data Structures

Describe in Detail

Essay▾

For the given graph, draw the DFS and BFS?

Image Showing the Graph

Explanation

Difference between DFS and BFS

BFS: A X G H P E M Y J

The BFS Graphs

DFS: A X H P E Y M J G

Shows the DFS Graph

Question 14

Data Structures
Edit

Describe in Detail

Essay▾

Which data structure would you use if you to do a lot of insert/deletes at place other than at the beginning or end?

Explanation

  • Linked list data structure would enable quick inserts and deletes at places other than at the beginning or end.
  • Linked list is a linear data structure.
  • Consist of group nodes in a sequence divided in two parts.
  • Each node consists of its own data and the address of the next node and forms a chain.
  • Used to create tree and graph.
Linked List Data Structure

Advantages of Linked Lists

  • Dynamic in nature with memory allocated when required.
  • Insertion and deletion operations can easily be implemented.
  • Stack and queue can be easily executed.
  • Reduces the access time.

Application of Linked List:

  • Used to implement stacks, queues, graphs, etc.
  • Elements easily inserted at beginning and end the list.
  • don՚t need to know the size in advance.

Types of Linked List:

  • Singly Linked List:
    • Contain nodes which have a data part as well as an address part.
  • Doubly Linked List:
    • Contains two links- first points to the previous node and the next points to the next node in the sequence.

Developed by: