SlideShare une entreprise Scribd logo
1  sur  10
1
Course/Year/Sem: B.Sc/ I / II
UCS18202 – Data Structures
UNIT – I -Part A
1. Define data structure?
Data structures is the branch of computer science that unleashes the knowledge
of how the data should be organized, how the flow of data should be controlled, and how
a data structure should be designed and implemented to reduce the complexity and
increase the efficiency of the algorithm.
2. What is the need of a data structure?
A data structure helps you to understand the relationship of one data element
with the other and organize it within the memory.
3. Write about asymptotic notation.
The complexity of algorithm is analyzed through asymptotic notations. The notation are
Big oh, Omega &Theta.
4. What is recursion?
A recursion routine is one whose design includes a call to itself.
5. Why Big ‘O’ notation.
Big ‘O’ notation, determine the time taken by the algorithm, and also the amount
of space required to run the algorithm.
6. Define a list.
List the term used to refer to the linear collection of data items.
7. State about Linked List.
Linked list is a linear collection of data elements, called nodes, where the linear
order is implemented by means of pointers. A linked list allocates memory for storing list
elements and connects elements together using pointers.
8. List out types of time complexity.
i. Best case time complexity.
ii. Average time complexity
iii. Worst case complexity.
9. Write about time complexity.
The time needed by an algorithm expressed as a function of the size of a
problem is called the TIME COMPLEXITY of the algorithm. The time complexity of a
program is the amount of computer time it needs to run to completion.
10. What do you mean by space complexity?
The space complexity of a program is the amount of memory it needs to run to
completion.
11. Define best case time complexity.
The best case time complexity of an algorithm is a measure of the minimum time that
the algorithm will require for an input of size “n”.
12. Define worst case time complexity.
SRM INSTITUTE OF SCIENCE AND TECHNOLOGY
Ramapuram Campus
Department of computer applications
2
The worst case time complexity of an algorithm is a measure of the maximum time that
the algorithm will require for an input of size “n”.
13. Define average case time complexity.
The average case time complexity of an algorithm is a measure of the average
time that the algorithm will require for an input of size “n”.
14. Define linear and non linear data structure.
Linear Data Structure:-
A data structure is said to be linear if its elements form a sequence or a linear
list. The linear data structures like an array, stacks, queues and linked lists organize data
in linear order.
Non Linear Structure:-
A data structure is said to be non linear if its elements form a hierarchical
classification where, data items appear at various levels.
Trees and Graphs are widely used non-linear data structures. Tree and graph structures
representhierarchical relationship between individual data elements. Graphs are nothing
but trees with certain restrictions removed.
15. List out the operations performed on data structure
 Insertion:-Insertion means adding new node into the data structures.
 Deletion:- Deletion means removing a node from the data structures.
 Traversal:- Traversing means accessing each record exactly once so that
certain items in the record may be processed.
 Searching: Finding the location of the record with a given key value or
finding the location of all records which satisfy one or more conditions.
 Sorting: Arranging the data in logical order.
 Merging:- Combining the records in two different sorted files into a single
sorted file.
16. Define pointer.
Pointers are special variables which contain the address of another memory
location.
17. State about array
An array is a collection of data elements of similar data types.
PART - B
1. What is complexity? Explain its types with example. (16)
2. Explain how to analysis an algorithm with suitable example.(16)
3. Discuss about the concepts of recursion in details.(8)
4. Briefly discuss about various operations of an array.(16)
5. Compare and explain pointers and arrays.(8)
UNIT II – PART A
1. Write about infix notation.
infix notation: X + Y
Operators are written in-between their operands.
2. Write about postfix notation.
Postfix notation (also known as "Reverse Polish notation"): X Y +
Operators are written after their operands.
3
3. Define stack. Give an example.
Stack is a linear data structure in which addition or deletion of elements takes place at
same end.
This end is often called the ‘top’ of the stack.
Example
Stack of plates, Stack of coins.
4. How to represent a stack in an array.
Draw the diagram from page no 130 and explain
5. List down the application of stack.
 Reversing a List
 Polish Notations
 Conversion of infix to Postfix expression
 Evaluation of Postfix Expression
 Conversion of infix to Prefix expression
 Evaluation of Prefix Expression
6. Define queue. Give an example.
Queue is a linear list of elements in which deletion of an element can take place
only at one end, called the front and insertion can take place only at the other end called
rear. The first element in the queue will be the first one to be removed from the list.
There for e Queues are also called FIFO lists.
Example:People waiting in the counter to purchase tickets
Computer examples: Queue of tasks waiting for the line printer .
7. Define circular queue.
Circular queues are the queues implemented in circular form rather than in a straight
line. Circular queues overcome the problem of unutilized space in linear queue
implemented as an array.
8. Define double ended queue.
A deque is a linear list in which elements can be added or removed at either end but not
in the middle. The items can be added or deleted from the front or rear end, but no
changes can be made elsewhere in the list.
9. What is priority queue? Given an example.
A priority queue is a collection of elements where each element is assigned a priority
and the order in which elements are deleted and processed is determined from the
following rules:
i. An element of higher priority is processed before any element of lower priority
ii. Two elements with the same priority are processed according to the order in
which they are added to the queue.
Timesharing system: - Programs of high priority are processed first, and programs with
the same priority form a standard queue.
10. What are the applications of queue?
 Airport Simulation
 Random Numbers
Part B
1. Explain various representation of stack with example.
4
2. Explain the following
i. Infix to postfix
ii. Evaluation of postfix expression.
3. Explain the following
i. Infix to prefix
ii. Evaluation of prefix.
4. Explain the concepts of circular queue with example.
5. Explain double ended queue with example.
6. Explain priority queue with example.
UNIT -III
1. Define Tree
Tree is non linear data structures. It is mainly used to represent data containing a
hierarchical relationship between elements.
2. List out the types of tree
a. General Tree
b. Binary Search Tree
c. Extended Binary Tree or 2 – Tree
d. Threaded Binary Tree
e. AVL Tree
f. 2 – 3 Tree
g. Heap
h. B – Tree.
i. Forest.
3. Give a example of tree.
Records, Family trees and table of contents.
4. State about binary tree
Binary tree is special type of tree in which every node or vertex has either no children,
one child, or two children. A binary tree is an important class of tree data structure in
which a node can have at most two children.
5. Write about binary search tree
The items must be stored in such a way that the key values in left subtree of the root are
less than the key value of the root, and the key values of all the nodes in the right
subtree of the root are greater than the key value of the root. When this relationship
holds in all the nodes in the tree then the tree is called a binary search tree.
5
6. What do you mean by siblings in a tree?
All the children of a given vertex or node are known as siblings.
7. Write about strictly binary tree.
If every non-leaf node in a binary tree has a non-empty left and right sub trees, the tree
is known as strictly binary tree.
8. Write about Red black trees
A red-black tree is an augmented binary search tree in which the arrangement of
vertices obeys the following constraints
 (Black rule): Every leaf is colored black.
 (Red rule): If a vertex is red, then both of its children are black.
 (Path rule) Every path from the root to a leaf contains the same number of black
vertices.
9. Define Degree
Degree of a node is the number of nodes connected to a particular node
6
In this tree the node is containing the data D has a degree 3. The degree of a leaf node
is always one.
10. What do you mean by height and depth of a tree.
The depth of a node is the number of edges from the root to the node. The height of a
node is the number of edges from the node to the deepest leaf. The height of a tree is
a height of the root. A full binary tree is a binary tree in which each node has exactly
zero or two children.
11. Define Heap.
Heap is complete binary tree. There are two types of heaps. If the value present at any
node is greater than its children, then the tree is called the max-heap. In the case of min-
heap the value present at any node is smaller than all its children
12. What are the different types of tree representation?
 List representation
 Representation of degree two tree
13. What are the Binary Tree Traversals?
 Preorder Traversal –
1. Visit the Root first,
2. Traverse the left subtree in preorder and
3. Traverse the right subtree in pre-order (Root-Left-Right Traversal )
 Inorder Traversal –
1. Traverse the (inorder)left subtree,
2. Visit the Root and
3. Traverse the (inorder) right subtree (Left-Root-Right Traversal )
 Postorder Traversal –
1. Traverse the left subtree in postorder
2. Traverse the right subtree in postorder,
3. Visit the Root (Left-Right-Root Traversal )
7
Part B
1. Explain Various type of trees
2. Briefly write about representation of trees
3. Describe tree traversal with an algorithm
Unit IV
1. Define Sorting
Sorting refers to the operation of arranging a set of data in some given order.
2. Write about internal sorting and external sorting
If all the data that is to be sorted can be adjusted at a time in main memory, the internal
sorting methods are used.
When the data to be sorted cannot be accommodated in the memory at the same time
and some has to be kept in auxiliary memory, then external sorting methods are used.
3. List out the type of sorting.
a. Bubble Sorting
b. Selection Sorting
c. Insertion Sorting
d. Radix Sorting
e. Shell Sorting
f. Heap Sorting
g. Binary Tree Sorting
h. Merge Sorting
4. Define searching
Searching is an operation which finds the place of a given element in the list. The search
is said to be successful or unsuccessful depending upon whether the element that is
being searched is found or not.
5. Mention the various types of searching
a. Linear Search
b. Binary Search
c. Indexed Sequential Search
6. Write about selection sorting
A sorting technique that is typically used for sequencing small lists. It starts by
comparing the entire list for the lowest item and moves it to the #1 position. It then
compares the rest of the list for the next-lowest item and places it in the #2 position and
so on until all items are in the required order. Selection sorts perform numerous
comparisons, but fewer data movements than other methods.
7. Write about bubble sorting.
8
Bubble Sort is an algorithm which is used to sort N elements that are given in a memory
for eg: an Array withN number of elements. Bubble Sort compares all the element one
by one and sort them based on their values.
It is called Bubble sort, because with each iteration the smaller element in the list
bubbles up towards the first place, just like a water bubble rises up to the water surface.
8. Define quick sort
In this method, an element called pivot is identified and that element is fixed in its place
by moving all the elements less than that to its left and all the elements greater than that
to its right.
Part B
1. Explain about Bubble sort with an example
2. Briefly write about searching techniques with an example
3. Explain about Insertion sort with an example
4. Describe selection and heap sort with an example
UNIT V
1.Define graph. How does it differ from tree?
A graph is a collection of nodes, called vertices and like segments, called arcs or edges
that connect pairs of nodes In other words, a graph consists of two sets. A set of vertices and a
set of lines. Graphs may be either directed or undirected.
Tree is special form of graph i.e. minimally connected graph and having only one path
between any two vertices.
Tree is a special case of graph having no loops, no circuits and no self-loops.
2 .Define directed graph or digraph?
It is a graph in which each line has a direction (arrow head) to its successor. The lines
in a directed graph are known as arcs. In a directed graph, the flow along the arcs
between two vertices can follow only the indicated direction.
3 .Define undirected graph.
It is a graph in which there is no direction (arrow head) on any of the lines, which are
known as edge. In an undirected graph, the flow between two vertices can go in either
direction.
4. Define adjacent vertices.
Two vertices in graph are said to be adjacent vertices or neighbors if an
edge directly connects them
5. Define path.
A path is a sequence of vertices in which each vertex is adjacent to the next one.
6.Define single source shortest path.
9
The single-source shortest path problem, in which we have to find shortest paths from
a source vertex v to all other vertices in the graph.
7. Define all pair shortest path.
The shortest path problem is the problem of finding a path between two vertices (or nodes) in
a graph such that the sum of the weights of its constituent edges is minimized.
8. What is completely connected graph?
A graph G is completely connected if for every pair of distinct vertices
vi,vj there exists an edge.
9. How to represent graph?
There are two standard ways to represent a graph G=(V, E) as a collection of adjacency
list or as adjacency matrix either way is applicable to both directed and undirected graphs.
10. Differentiate tree and graph.
Write any four differences frombelow point.
Difference between Trees and Graphs
Trees Graphs
Path Tree is special form of graph i.e. minimally
connected graph and having only one path
between any two vertices.
In graph there can be more than one path
i.e. graph can have uni-directional or bi-
directional paths (edges) between nodes
Loops Tree is a special case of graph having no loops,
no circuits and no self-loops.
Graph can have loops, circuits as well as
can have self-loops.
Root Node In tree there is exactly one root node and
every child have only one parent.
In graph there is no such concept
of root node.
Parent Child
relationship
In trees, there is parent child relationship so flow
can be there with direction top to bottom or vice
versa.
In Graph there is no such parent child
relationship.
Complexity Trees are less complex then graphs as having no
cycles, no self-loops and still connected.
Graphs are more complex in compare to
trees as it can have cycles, loops etc
Types of
Traversal
Tree traversal is a kind of special case of traversal
of graph. Tree is traversed in Pre-Order, In-
Order and Post-Order(all three in DFS or in BFS
algorithm)
Graph is traversed by DFS: Depth First
Searchand in BFS : Breadth First
Search algorithm
Connection
Rules
In trees, there are many rules / restrictions for
making connections between nodes through
edges.
In graphs no such rules/ restrictions are
there for connecting the nodes through
edges.
DAG Trees come in the category of DAG : Directed
Acyclic Graphs is a kind of directed graph that
have no cycles.
Graph can be Cyclic or Acyclic.
Different
Types
Different types of trees are : Binary Tree , Binary
Search Tree, AVL tree, Heaps.
There are mainly two types of Graphs
: Directed and Undirected graphs.
Applications Tree applications : sorting and searching like Tree
Traversal & Binary Search.
Graph applications : Coloring of maps, in
OR (PERT & CPM), algorithms, Graph
10
coloring, job scheduling, etc.
No. of edges Tree always has n-1 edges. In Graph, no. of edges depend on the
graph.
Model Tree is a hierarchical model. Graph is a network model.
Figure

Contenu connexe

Tendances

What is Link list? explained with animations
What is Link list? explained with animationsWhat is Link list? explained with animations
What is Link list? explained with animationsPratikNaik41
 
linked list in data structure
linked list in data structure linked list in data structure
linked list in data structure shameen khan
 
358 33 powerpoint-slides_3-pointers_chapter-3
358 33 powerpoint-slides_3-pointers_chapter-3358 33 powerpoint-slides_3-pointers_chapter-3
358 33 powerpoint-slides_3-pointers_chapter-3sumitbardhan
 
Bca data structures linked list mrs.sowmya jyothi
Bca data structures linked list mrs.sowmya jyothiBca data structures linked list mrs.sowmya jyothi
Bca data structures linked list mrs.sowmya jyothiSowmya Jyothi
 
Queue - Data Structure - Notes
Queue - Data Structure - NotesQueue - Data Structure - Notes
Queue - Data Structure - NotesOmprakash Chauhan
 
10. Search Tree - Data Structures using C++ by Varsha Patil
10. Search Tree - Data Structures using C++ by Varsha Patil10. Search Tree - Data Structures using C++ by Varsha Patil
10. Search Tree - Data Structures using C++ by Varsha Patilwidespreadpromotion
 
Priority queue in DSA
Priority queue in DSAPriority queue in DSA
Priority queue in DSAjunnubabu
 
358 33 powerpoint-slides_4-introduction-data-structures_chapter-4
358 33 powerpoint-slides_4-introduction-data-structures_chapter-4358 33 powerpoint-slides_4-introduction-data-structures_chapter-4
358 33 powerpoint-slides_4-introduction-data-structures_chapter-4sumitbardhan
 
File handling in Python
File handling in PythonFile handling in Python
File handling in PythonMegha V
 
Linked List, Types of Linked LIst, Various Operations, Applications of Linked...
Linked List, Types of Linked LIst, Various Operations, Applications of Linked...Linked List, Types of Linked LIst, Various Operations, Applications of Linked...
Linked List, Types of Linked LIst, Various Operations, Applications of Linked...Balwant Gorad
 
Data Structures - Lecture 9 [Stack & Queue using Linked List]
 Data Structures - Lecture 9 [Stack & Queue using Linked List] Data Structures - Lecture 9 [Stack & Queue using Linked List]
Data Structures - Lecture 9 [Stack & Queue using Linked List]Muhammad Hammad Waseem
 

Tendances (20)

What is Link list? explained with animations
What is Link list? explained with animationsWhat is Link list? explained with animations
What is Link list? explained with animations
 
linked list in data structure
linked list in data structure linked list in data structure
linked list in data structure
 
Tree - Data Structure
Tree - Data StructureTree - Data Structure
Tree - Data Structure
 
single linked list
single linked listsingle linked list
single linked list
 
stack & queue
stack & queuestack & queue
stack & queue
 
Binary Tree Traversal
Binary Tree TraversalBinary Tree Traversal
Binary Tree Traversal
 
Data structures using c
Data structures using cData structures using c
Data structures using c
 
358 33 powerpoint-slides_3-pointers_chapter-3
358 33 powerpoint-slides_3-pointers_chapter-3358 33 powerpoint-slides_3-pointers_chapter-3
358 33 powerpoint-slides_3-pointers_chapter-3
 
Bca data structures linked list mrs.sowmya jyothi
Bca data structures linked list mrs.sowmya jyothiBca data structures linked list mrs.sowmya jyothi
Bca data structures linked list mrs.sowmya jyothi
 
Queue - Data Structure - Notes
Queue - Data Structure - NotesQueue - Data Structure - Notes
Queue - Data Structure - Notes
 
10. Search Tree - Data Structures using C++ by Varsha Patil
10. Search Tree - Data Structures using C++ by Varsha Patil10. Search Tree - Data Structures using C++ by Varsha Patil
10. Search Tree - Data Structures using C++ by Varsha Patil
 
Priority queue in DSA
Priority queue in DSAPriority queue in DSA
Priority queue in DSA
 
Stack and queue
Stack and queueStack and queue
Stack and queue
 
358 33 powerpoint-slides_4-introduction-data-structures_chapter-4
358 33 powerpoint-slides_4-introduction-data-structures_chapter-4358 33 powerpoint-slides_4-introduction-data-structures_chapter-4
358 33 powerpoint-slides_4-introduction-data-structures_chapter-4
 
File handling in Python
File handling in PythonFile handling in Python
File handling in Python
 
Graph traversals in Data Structures
Graph traversals in Data StructuresGraph traversals in Data Structures
Graph traversals in Data Structures
 
Linked List, Types of Linked LIst, Various Operations, Applications of Linked...
Linked List, Types of Linked LIst, Various Operations, Applications of Linked...Linked List, Types of Linked LIst, Various Operations, Applications of Linked...
Linked List, Types of Linked LIst, Various Operations, Applications of Linked...
 
Linked list
Linked listLinked list
Linked list
 
Data Structures - Lecture 9 [Stack & Queue using Linked List]
 Data Structures - Lecture 9 [Stack & Queue using Linked List] Data Structures - Lecture 9 [Stack & Queue using Linked List]
Data Structures - Lecture 9 [Stack & Queue using Linked List]
 
Stack and Queue
Stack and Queue Stack and Queue
Stack and Queue
 

Similaire à Data Structure Question Bank(2 marks)

Notes of bca Question paper for exams and tests
Notes of bca Question paper for exams and testsNotes of bca Question paper for exams and tests
Notes of bca Question paper for exams and testspriyanshukumar97908
 
CS8391-DATA-STRUCTURES.pdf
CS8391-DATA-STRUCTURES.pdfCS8391-DATA-STRUCTURES.pdf
CS8391-DATA-STRUCTURES.pdfraji175286
 
2 marks- DS using python
2 marks- DS using python2 marks- DS using python
2 marks- DS using pythonLavanyaJ28
 
Introduction to Data Structure
Introduction to Data StructureIntroduction to Data Structure
Introduction to Data StructureJazz Jinia Bhowmik
 
SIX WEEKS SUMMER TRAINING REPORT.pptx
SIX WEEKS SUMMER TRAINING REPORT.pptxSIX WEEKS SUMMER TRAINING REPORT.pptx
SIX WEEKS SUMMER TRAINING REPORT.pptxsagabo1
 
Ch 1 intriductions
Ch 1 intriductionsCh 1 intriductions
Ch 1 intriductionsirshad17
 
DATA STRUCTURES - SHORT NOTES
DATA STRUCTURES - SHORT NOTESDATA STRUCTURES - SHORT NOTES
DATA STRUCTURES - SHORT NOTESsuthi
 
2. Introduction to Data Structure.pdf
2. Introduction to Data Structure.pdf2. Introduction to Data Structure.pdf
2. Introduction to Data Structure.pdfSulabhPawaia
 
Ii pu cs practical viva voce questions
Ii pu cs  practical viva voce questionsIi pu cs  practical viva voce questions
Ii pu cs practical viva voce questionsProf. Dr. K. Adisesha
 
DS Module 1.pptx
DS Module 1.pptxDS Module 1.pptx
DS Module 1.pptxsarala9
 
DS Module 1.pptx
DS Module 1.pptxDS Module 1.pptx
DS Module 1.pptxSaralaT3
 
Introduction to data structures (ss)
Introduction to data structures (ss)Introduction to data structures (ss)
Introduction to data structures (ss)Madishetty Prathibha
 
Bit by bit into data structures
Bit by bit into data structuresBit by bit into data structures
Bit by bit into data structuresHridyesh Bisht
 
Datastructures and algorithms prepared by M.V.Brehmanada Reddy
Datastructures and algorithms prepared by M.V.Brehmanada ReddyDatastructures and algorithms prepared by M.V.Brehmanada Reddy
Datastructures and algorithms prepared by M.V.Brehmanada ReddyMalikireddy Bramhananda Reddy
 

Similaire à Data Structure Question Bank(2 marks) (20)

Notes of bca Question paper for exams and tests
Notes of bca Question paper for exams and testsNotes of bca Question paper for exams and tests
Notes of bca Question paper for exams and tests
 
CS8391-DATA-STRUCTURES.pdf
CS8391-DATA-STRUCTURES.pdfCS8391-DATA-STRUCTURES.pdf
CS8391-DATA-STRUCTURES.pdf
 
2 marks- DS using python
2 marks- DS using python2 marks- DS using python
2 marks- DS using python
 
Introduction to Data Structure
Introduction to Data StructureIntroduction to Data Structure
Introduction to Data Structure
 
SIX WEEKS SUMMER TRAINING REPORT.pptx
SIX WEEKS SUMMER TRAINING REPORT.pptxSIX WEEKS SUMMER TRAINING REPORT.pptx
SIX WEEKS SUMMER TRAINING REPORT.pptx
 
Data structure
 Data structure Data structure
Data structure
 
104333 sri vidhya eng notes
104333 sri vidhya eng notes104333 sri vidhya eng notes
104333 sri vidhya eng notes
 
Ch 1 intriductions
Ch 1 intriductionsCh 1 intriductions
Ch 1 intriductions
 
DATA STRUCTURES - SHORT NOTES
DATA STRUCTURES - SHORT NOTESDATA STRUCTURES - SHORT NOTES
DATA STRUCTURES - SHORT NOTES
 
2. Introduction to Data Structure.pdf
2. Introduction to Data Structure.pdf2. Introduction to Data Structure.pdf
2. Introduction to Data Structure.pdf
 
Ii pu cs practical viva voce questions
Ii pu cs  practical viva voce questionsIi pu cs  practical viva voce questions
Ii pu cs practical viva voce questions
 
M v bramhananda reddy dsa complete notes
M v bramhananda reddy dsa complete notesM v bramhananda reddy dsa complete notes
M v bramhananda reddy dsa complete notes
 
DS Module 1.pptx
DS Module 1.pptxDS Module 1.pptx
DS Module 1.pptx
 
DS Module 1.pptx
DS Module 1.pptxDS Module 1.pptx
DS Module 1.pptx
 
Data structures
Data structuresData structures
Data structures
 
Datastructure
DatastructureDatastructure
Datastructure
 
Introduction to data structures (ss)
Introduction to data structures (ss)Introduction to data structures (ss)
Introduction to data structures (ss)
 
CSE 443 (1).pptx
CSE 443 (1).pptxCSE 443 (1).pptx
CSE 443 (1).pptx
 
Bit by bit into data structures
Bit by bit into data structuresBit by bit into data structures
Bit by bit into data structures
 
Datastructures and algorithms prepared by M.V.Brehmanada Reddy
Datastructures and algorithms prepared by M.V.Brehmanada ReddyDatastructures and algorithms prepared by M.V.Brehmanada Reddy
Datastructures and algorithms prepared by M.V.Brehmanada Reddy
 

Dernier

Grant Readiness 101 TechSoup and Remy Consulting
Grant Readiness 101 TechSoup and Remy ConsultingGrant Readiness 101 TechSoup and Remy Consulting
Grant Readiness 101 TechSoup and Remy ConsultingTechSoup
 
The Most Excellent Way | 1 Corinthians 13
The Most Excellent Way | 1 Corinthians 13The Most Excellent Way | 1 Corinthians 13
The Most Excellent Way | 1 Corinthians 13Steve Thomason
 
CARE OF CHILD IN INCUBATOR..........pptx
CARE OF CHILD IN INCUBATOR..........pptxCARE OF CHILD IN INCUBATOR..........pptx
CARE OF CHILD IN INCUBATOR..........pptxGaneshChakor2
 
Arihant handbook biology for class 11 .pdf
Arihant handbook biology for class 11 .pdfArihant handbook biology for class 11 .pdf
Arihant handbook biology for class 11 .pdfchloefrazer622
 
Z Score,T Score, Percential Rank and Box Plot Graph
Z Score,T Score, Percential Rank and Box Plot GraphZ Score,T Score, Percential Rank and Box Plot Graph
Z Score,T Score, Percential Rank and Box Plot GraphThiyagu K
 
Web & Social Media Analytics Previous Year Question Paper.pdf
Web & Social Media Analytics Previous Year Question Paper.pdfWeb & Social Media Analytics Previous Year Question Paper.pdf
Web & Social Media Analytics Previous Year Question Paper.pdfJayanti Pande
 
Beyond the EU: DORA and NIS 2 Directive's Global Impact
Beyond the EU: DORA and NIS 2 Directive's Global ImpactBeyond the EU: DORA and NIS 2 Directive's Global Impact
Beyond the EU: DORA and NIS 2 Directive's Global ImpactPECB
 
1029 - Danh muc Sach Giao Khoa 10 . pdf
1029 -  Danh muc Sach Giao Khoa 10 . pdf1029 -  Danh muc Sach Giao Khoa 10 . pdf
1029 - Danh muc Sach Giao Khoa 10 . pdfQucHHunhnh
 
The basics of sentences session 2pptx copy.pptx
The basics of sentences session 2pptx copy.pptxThe basics of sentences session 2pptx copy.pptx
The basics of sentences session 2pptx copy.pptxheathfieldcps1
 
Call Girls in Dwarka Mor Delhi Contact Us 9654467111
Call Girls in Dwarka Mor Delhi Contact Us 9654467111Call Girls in Dwarka Mor Delhi Contact Us 9654467111
Call Girls in Dwarka Mor Delhi Contact Us 9654467111Sapana Sha
 
microwave assisted reaction. General introduction
microwave assisted reaction. General introductionmicrowave assisted reaction. General introduction
microwave assisted reaction. General introductionMaksud Ahmed
 
Paris 2024 Olympic Geographies - an activity
Paris 2024 Olympic Geographies - an activityParis 2024 Olympic Geographies - an activity
Paris 2024 Olympic Geographies - an activityGeoBlogs
 
Measures of Central Tendency: Mean, Median and Mode
Measures of Central Tendency: Mean, Median and ModeMeasures of Central Tendency: Mean, Median and Mode
Measures of Central Tendency: Mean, Median and ModeThiyagu K
 
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptx
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptxPOINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptx
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptxSayali Powar
 
Contemporary philippine arts from the regions_PPT_Module_12 [Autosaved] (1).pptx
Contemporary philippine arts from the regions_PPT_Module_12 [Autosaved] (1).pptxContemporary philippine arts from the regions_PPT_Module_12 [Autosaved] (1).pptx
Contemporary philippine arts from the regions_PPT_Module_12 [Autosaved] (1).pptxRoyAbrique
 
Employee wellbeing at the workplace.pptx
Employee wellbeing at the workplace.pptxEmployee wellbeing at the workplace.pptx
Employee wellbeing at the workplace.pptxNirmalaLoungPoorunde1
 
Software Engineering Methodologies (overview)
Software Engineering Methodologies (overview)Software Engineering Methodologies (overview)
Software Engineering Methodologies (overview)eniolaolutunde
 
“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...
“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...
“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...Marc Dusseiller Dusjagr
 

Dernier (20)

Grant Readiness 101 TechSoup and Remy Consulting
Grant Readiness 101 TechSoup and Remy ConsultingGrant Readiness 101 TechSoup and Remy Consulting
Grant Readiness 101 TechSoup and Remy Consulting
 
The Most Excellent Way | 1 Corinthians 13
The Most Excellent Way | 1 Corinthians 13The Most Excellent Way | 1 Corinthians 13
The Most Excellent Way | 1 Corinthians 13
 
CARE OF CHILD IN INCUBATOR..........pptx
CARE OF CHILD IN INCUBATOR..........pptxCARE OF CHILD IN INCUBATOR..........pptx
CARE OF CHILD IN INCUBATOR..........pptx
 
Arihant handbook biology for class 11 .pdf
Arihant handbook biology for class 11 .pdfArihant handbook biology for class 11 .pdf
Arihant handbook biology for class 11 .pdf
 
Z Score,T Score, Percential Rank and Box Plot Graph
Z Score,T Score, Percential Rank and Box Plot GraphZ Score,T Score, Percential Rank and Box Plot Graph
Z Score,T Score, Percential Rank and Box Plot Graph
 
Web & Social Media Analytics Previous Year Question Paper.pdf
Web & Social Media Analytics Previous Year Question Paper.pdfWeb & Social Media Analytics Previous Year Question Paper.pdf
Web & Social Media Analytics Previous Year Question Paper.pdf
 
Beyond the EU: DORA and NIS 2 Directive's Global Impact
Beyond the EU: DORA and NIS 2 Directive's Global ImpactBeyond the EU: DORA and NIS 2 Directive's Global Impact
Beyond the EU: DORA and NIS 2 Directive's Global Impact
 
1029 - Danh muc Sach Giao Khoa 10 . pdf
1029 -  Danh muc Sach Giao Khoa 10 . pdf1029 -  Danh muc Sach Giao Khoa 10 . pdf
1029 - Danh muc Sach Giao Khoa 10 . pdf
 
The basics of sentences session 2pptx copy.pptx
The basics of sentences session 2pptx copy.pptxThe basics of sentences session 2pptx copy.pptx
The basics of sentences session 2pptx copy.pptx
 
Call Girls in Dwarka Mor Delhi Contact Us 9654467111
Call Girls in Dwarka Mor Delhi Contact Us 9654467111Call Girls in Dwarka Mor Delhi Contact Us 9654467111
Call Girls in Dwarka Mor Delhi Contact Us 9654467111
 
microwave assisted reaction. General introduction
microwave assisted reaction. General introductionmicrowave assisted reaction. General introduction
microwave assisted reaction. General introduction
 
Paris 2024 Olympic Geographies - an activity
Paris 2024 Olympic Geographies - an activityParis 2024 Olympic Geographies - an activity
Paris 2024 Olympic Geographies - an activity
 
Measures of Central Tendency: Mean, Median and Mode
Measures of Central Tendency: Mean, Median and ModeMeasures of Central Tendency: Mean, Median and Mode
Measures of Central Tendency: Mean, Median and Mode
 
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptx
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptxPOINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptx
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptx
 
Contemporary philippine arts from the regions_PPT_Module_12 [Autosaved] (1).pptx
Contemporary philippine arts from the regions_PPT_Module_12 [Autosaved] (1).pptxContemporary philippine arts from the regions_PPT_Module_12 [Autosaved] (1).pptx
Contemporary philippine arts from the regions_PPT_Module_12 [Autosaved] (1).pptx
 
Mattingly "AI & Prompt Design: The Basics of Prompt Design"
Mattingly "AI & Prompt Design: The Basics of Prompt Design"Mattingly "AI & Prompt Design: The Basics of Prompt Design"
Mattingly "AI & Prompt Design: The Basics of Prompt Design"
 
Employee wellbeing at the workplace.pptx
Employee wellbeing at the workplace.pptxEmployee wellbeing at the workplace.pptx
Employee wellbeing at the workplace.pptx
 
Staff of Color (SOC) Retention Efforts DDSD
Staff of Color (SOC) Retention Efforts DDSDStaff of Color (SOC) Retention Efforts DDSD
Staff of Color (SOC) Retention Efforts DDSD
 
Software Engineering Methodologies (overview)
Software Engineering Methodologies (overview)Software Engineering Methodologies (overview)
Software Engineering Methodologies (overview)
 
“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...
“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...
“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...
 

Data Structure Question Bank(2 marks)

  • 1. 1 Course/Year/Sem: B.Sc/ I / II UCS18202 – Data Structures UNIT – I -Part A 1. Define data structure? Data structures is the branch of computer science that unleashes the knowledge of how the data should be organized, how the flow of data should be controlled, and how a data structure should be designed and implemented to reduce the complexity and increase the efficiency of the algorithm. 2. What is the need of a data structure? A data structure helps you to understand the relationship of one data element with the other and organize it within the memory. 3. Write about asymptotic notation. The complexity of algorithm is analyzed through asymptotic notations. The notation are Big oh, Omega &Theta. 4. What is recursion? A recursion routine is one whose design includes a call to itself. 5. Why Big ‘O’ notation. Big ‘O’ notation, determine the time taken by the algorithm, and also the amount of space required to run the algorithm. 6. Define a list. List the term used to refer to the linear collection of data items. 7. State about Linked List. Linked list is a linear collection of data elements, called nodes, where the linear order is implemented by means of pointers. A linked list allocates memory for storing list elements and connects elements together using pointers. 8. List out types of time complexity. i. Best case time complexity. ii. Average time complexity iii. Worst case complexity. 9. Write about time complexity. The time needed by an algorithm expressed as a function of the size of a problem is called the TIME COMPLEXITY of the algorithm. The time complexity of a program is the amount of computer time it needs to run to completion. 10. What do you mean by space complexity? The space complexity of a program is the amount of memory it needs to run to completion. 11. Define best case time complexity. The best case time complexity of an algorithm is a measure of the minimum time that the algorithm will require for an input of size “n”. 12. Define worst case time complexity. SRM INSTITUTE OF SCIENCE AND TECHNOLOGY Ramapuram Campus Department of computer applications
  • 2. 2 The worst case time complexity of an algorithm is a measure of the maximum time that the algorithm will require for an input of size “n”. 13. Define average case time complexity. The average case time complexity of an algorithm is a measure of the average time that the algorithm will require for an input of size “n”. 14. Define linear and non linear data structure. Linear Data Structure:- A data structure is said to be linear if its elements form a sequence or a linear list. The linear data structures like an array, stacks, queues and linked lists organize data in linear order. Non Linear Structure:- A data structure is said to be non linear if its elements form a hierarchical classification where, data items appear at various levels. Trees and Graphs are widely used non-linear data structures. Tree and graph structures representhierarchical relationship between individual data elements. Graphs are nothing but trees with certain restrictions removed. 15. List out the operations performed on data structure  Insertion:-Insertion means adding new node into the data structures.  Deletion:- Deletion means removing a node from the data structures.  Traversal:- Traversing means accessing each record exactly once so that certain items in the record may be processed.  Searching: Finding the location of the record with a given key value or finding the location of all records which satisfy one or more conditions.  Sorting: Arranging the data in logical order.  Merging:- Combining the records in two different sorted files into a single sorted file. 16. Define pointer. Pointers are special variables which contain the address of another memory location. 17. State about array An array is a collection of data elements of similar data types. PART - B 1. What is complexity? Explain its types with example. (16) 2. Explain how to analysis an algorithm with suitable example.(16) 3. Discuss about the concepts of recursion in details.(8) 4. Briefly discuss about various operations of an array.(16) 5. Compare and explain pointers and arrays.(8) UNIT II – PART A 1. Write about infix notation. infix notation: X + Y Operators are written in-between their operands. 2. Write about postfix notation. Postfix notation (also known as "Reverse Polish notation"): X Y + Operators are written after their operands.
  • 3. 3 3. Define stack. Give an example. Stack is a linear data structure in which addition or deletion of elements takes place at same end. This end is often called the ‘top’ of the stack. Example Stack of plates, Stack of coins. 4. How to represent a stack in an array. Draw the diagram from page no 130 and explain 5. List down the application of stack.  Reversing a List  Polish Notations  Conversion of infix to Postfix expression  Evaluation of Postfix Expression  Conversion of infix to Prefix expression  Evaluation of Prefix Expression 6. Define queue. Give an example. Queue is a linear list of elements in which deletion of an element can take place only at one end, called the front and insertion can take place only at the other end called rear. The first element in the queue will be the first one to be removed from the list. There for e Queues are also called FIFO lists. Example:People waiting in the counter to purchase tickets Computer examples: Queue of tasks waiting for the line printer . 7. Define circular queue. Circular queues are the queues implemented in circular form rather than in a straight line. Circular queues overcome the problem of unutilized space in linear queue implemented as an array. 8. Define double ended queue. A deque is a linear list in which elements can be added or removed at either end but not in the middle. The items can be added or deleted from the front or rear end, but no changes can be made elsewhere in the list. 9. What is priority queue? Given an example. A priority queue is a collection of elements where each element is assigned a priority and the order in which elements are deleted and processed is determined from the following rules: i. An element of higher priority is processed before any element of lower priority ii. Two elements with the same priority are processed according to the order in which they are added to the queue. Timesharing system: - Programs of high priority are processed first, and programs with the same priority form a standard queue. 10. What are the applications of queue?  Airport Simulation  Random Numbers Part B 1. Explain various representation of stack with example.
  • 4. 4 2. Explain the following i. Infix to postfix ii. Evaluation of postfix expression. 3. Explain the following i. Infix to prefix ii. Evaluation of prefix. 4. Explain the concepts of circular queue with example. 5. Explain double ended queue with example. 6. Explain priority queue with example. UNIT -III 1. Define Tree Tree is non linear data structures. It is mainly used to represent data containing a hierarchical relationship between elements. 2. List out the types of tree a. General Tree b. Binary Search Tree c. Extended Binary Tree or 2 – Tree d. Threaded Binary Tree e. AVL Tree f. 2 – 3 Tree g. Heap h. B – Tree. i. Forest. 3. Give a example of tree. Records, Family trees and table of contents. 4. State about binary tree Binary tree is special type of tree in which every node or vertex has either no children, one child, or two children. A binary tree is an important class of tree data structure in which a node can have at most two children. 5. Write about binary search tree The items must be stored in such a way that the key values in left subtree of the root are less than the key value of the root, and the key values of all the nodes in the right subtree of the root are greater than the key value of the root. When this relationship holds in all the nodes in the tree then the tree is called a binary search tree.
  • 5. 5 6. What do you mean by siblings in a tree? All the children of a given vertex or node are known as siblings. 7. Write about strictly binary tree. If every non-leaf node in a binary tree has a non-empty left and right sub trees, the tree is known as strictly binary tree. 8. Write about Red black trees A red-black tree is an augmented binary search tree in which the arrangement of vertices obeys the following constraints  (Black rule): Every leaf is colored black.  (Red rule): If a vertex is red, then both of its children are black.  (Path rule) Every path from the root to a leaf contains the same number of black vertices. 9. Define Degree Degree of a node is the number of nodes connected to a particular node
  • 6. 6 In this tree the node is containing the data D has a degree 3. The degree of a leaf node is always one. 10. What do you mean by height and depth of a tree. The depth of a node is the number of edges from the root to the node. The height of a node is the number of edges from the node to the deepest leaf. The height of a tree is a height of the root. A full binary tree is a binary tree in which each node has exactly zero or two children. 11. Define Heap. Heap is complete binary tree. There are two types of heaps. If the value present at any node is greater than its children, then the tree is called the max-heap. In the case of min- heap the value present at any node is smaller than all its children 12. What are the different types of tree representation?  List representation  Representation of degree two tree 13. What are the Binary Tree Traversals?  Preorder Traversal – 1. Visit the Root first, 2. Traverse the left subtree in preorder and 3. Traverse the right subtree in pre-order (Root-Left-Right Traversal )  Inorder Traversal – 1. Traverse the (inorder)left subtree, 2. Visit the Root and 3. Traverse the (inorder) right subtree (Left-Root-Right Traversal )  Postorder Traversal – 1. Traverse the left subtree in postorder 2. Traverse the right subtree in postorder, 3. Visit the Root (Left-Right-Root Traversal )
  • 7. 7 Part B 1. Explain Various type of trees 2. Briefly write about representation of trees 3. Describe tree traversal with an algorithm Unit IV 1. Define Sorting Sorting refers to the operation of arranging a set of data in some given order. 2. Write about internal sorting and external sorting If all the data that is to be sorted can be adjusted at a time in main memory, the internal sorting methods are used. When the data to be sorted cannot be accommodated in the memory at the same time and some has to be kept in auxiliary memory, then external sorting methods are used. 3. List out the type of sorting. a. Bubble Sorting b. Selection Sorting c. Insertion Sorting d. Radix Sorting e. Shell Sorting f. Heap Sorting g. Binary Tree Sorting h. Merge Sorting 4. Define searching Searching is an operation which finds the place of a given element in the list. The search is said to be successful or unsuccessful depending upon whether the element that is being searched is found or not. 5. Mention the various types of searching a. Linear Search b. Binary Search c. Indexed Sequential Search 6. Write about selection sorting A sorting technique that is typically used for sequencing small lists. It starts by comparing the entire list for the lowest item and moves it to the #1 position. It then compares the rest of the list for the next-lowest item and places it in the #2 position and so on until all items are in the required order. Selection sorts perform numerous comparisons, but fewer data movements than other methods. 7. Write about bubble sorting.
  • 8. 8 Bubble Sort is an algorithm which is used to sort N elements that are given in a memory for eg: an Array withN number of elements. Bubble Sort compares all the element one by one and sort them based on their values. It is called Bubble sort, because with each iteration the smaller element in the list bubbles up towards the first place, just like a water bubble rises up to the water surface. 8. Define quick sort In this method, an element called pivot is identified and that element is fixed in its place by moving all the elements less than that to its left and all the elements greater than that to its right. Part B 1. Explain about Bubble sort with an example 2. Briefly write about searching techniques with an example 3. Explain about Insertion sort with an example 4. Describe selection and heap sort with an example UNIT V 1.Define graph. How does it differ from tree? A graph is a collection of nodes, called vertices and like segments, called arcs or edges that connect pairs of nodes In other words, a graph consists of two sets. A set of vertices and a set of lines. Graphs may be either directed or undirected. Tree is special form of graph i.e. minimally connected graph and having only one path between any two vertices. Tree is a special case of graph having no loops, no circuits and no self-loops. 2 .Define directed graph or digraph? It is a graph in which each line has a direction (arrow head) to its successor. The lines in a directed graph are known as arcs. In a directed graph, the flow along the arcs between two vertices can follow only the indicated direction. 3 .Define undirected graph. It is a graph in which there is no direction (arrow head) on any of the lines, which are known as edge. In an undirected graph, the flow between two vertices can go in either direction. 4. Define adjacent vertices. Two vertices in graph are said to be adjacent vertices or neighbors if an edge directly connects them 5. Define path. A path is a sequence of vertices in which each vertex is adjacent to the next one. 6.Define single source shortest path.
  • 9. 9 The single-source shortest path problem, in which we have to find shortest paths from a source vertex v to all other vertices in the graph. 7. Define all pair shortest path. The shortest path problem is the problem of finding a path between two vertices (or nodes) in a graph such that the sum of the weights of its constituent edges is minimized. 8. What is completely connected graph? A graph G is completely connected if for every pair of distinct vertices vi,vj there exists an edge. 9. How to represent graph? There are two standard ways to represent a graph G=(V, E) as a collection of adjacency list or as adjacency matrix either way is applicable to both directed and undirected graphs. 10. Differentiate tree and graph. Write any four differences frombelow point. Difference between Trees and Graphs Trees Graphs Path Tree is special form of graph i.e. minimally connected graph and having only one path between any two vertices. In graph there can be more than one path i.e. graph can have uni-directional or bi- directional paths (edges) between nodes Loops Tree is a special case of graph having no loops, no circuits and no self-loops. Graph can have loops, circuits as well as can have self-loops. Root Node In tree there is exactly one root node and every child have only one parent. In graph there is no such concept of root node. Parent Child relationship In trees, there is parent child relationship so flow can be there with direction top to bottom or vice versa. In Graph there is no such parent child relationship. Complexity Trees are less complex then graphs as having no cycles, no self-loops and still connected. Graphs are more complex in compare to trees as it can have cycles, loops etc Types of Traversal Tree traversal is a kind of special case of traversal of graph. Tree is traversed in Pre-Order, In- Order and Post-Order(all three in DFS or in BFS algorithm) Graph is traversed by DFS: Depth First Searchand in BFS : Breadth First Search algorithm Connection Rules In trees, there are many rules / restrictions for making connections between nodes through edges. In graphs no such rules/ restrictions are there for connecting the nodes through edges. DAG Trees come in the category of DAG : Directed Acyclic Graphs is a kind of directed graph that have no cycles. Graph can be Cyclic or Acyclic. Different Types Different types of trees are : Binary Tree , Binary Search Tree, AVL tree, Heaps. There are mainly two types of Graphs : Directed and Undirected graphs. Applications Tree applications : sorting and searching like Tree Traversal & Binary Search. Graph applications : Coloring of maps, in OR (PERT & CPM), algorithms, Graph
  • 10. 10 coloring, job scheduling, etc. No. of edges Tree always has n-1 edges. In Graph, no. of edges depend on the graph. Model Tree is a hierarchical model. Graph is a network model. Figure