Basic CSData Structures [3i Infotech Placement]: Sample Questions 11  12 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 11
Question 12
Data Structures
Edit
Describe in Detail
Essay▾Define of common data structures:
Stack
Queue
General purpose of linked list
Singly vs. doubly linked lists.
Explanation
 Stack:
 Stack is a linear data structure which follows a particular order in which the operations are performed.
 The order LIFO (Last In First Out) or FILO (First In Last Out) .
 Queue:
 Linear data structure.
 Additions are made at the end or tail of the queue while removals are made from the front or head of the queue.
 Queue is referred to FIFO structure for its First in First Out Access.
 General purpose of linked list
 A linear data structure
 Common data structure consisting of group of 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 trees and graphs.
 Singly vs. doubly linked lists.
Singly Linked List  Doubly Linked List 
Allow one way travel can access successor  Allows two way travel using two pointers next and previous 
Uses less memory per node  Uses more memory per node than singly linked list 
Complexity of insertion and deletion at known position is O (n)  Complexity of Insertion and Deletion at known position is O (1) . 
There is a allowing delete from a singlylinked list in O (1) , but the list must be circular  Used in places where singlylinked lists would not work but they require slightly more “housekeeping” , and are slightly less efficient on insertions as the result 
Each node contains at least two parts:
 Each node contains at least three parts:
