Data Structure's Notes: (Amit Anwade - AIR-142)
Data Structure's Notes: (Amit Anwade - AIR-142)
-> A ...Sentinel... indicates the end of the list.sentinel node is a specifically designated node
used with linked lists and trees as a traversal path terminator
-> A ....dequeue.... is a linear list in which insertions and deletions are made to from either
end of the structure.
-> Indexing the....middle.... element in the list is not possible in linked lists.
-> To insert a new node in linked list free node will be available in....> Avail list....
-> A singly linked list is also called as........> one way chain or one way list
-> A ..Circular header... list is a header list where the node points back to the header node
-> Header linked lists are frequently used for maintaining....Polynomials.... in memory
-> The pointer that points to the first node in the list is called as........front or first
-> A doubly linked list is also called as.......... two way chain or two way list
-> The list that requires two pointer variables FIRST and LAST is called........Two way list
-> If the availability list is null, then the condition is said to be......... availability list underflow
-> The list which has its own pointer is called........ free pool
C. Linked list with header and trailer nodes 🗸D. None of the above 🗸
-> A .....grounded header list..... is a header list where the last node contains the null pointer.
-> A ......circular header list....... is a header list where the last node points back to the header
node.
C. time consuming
Which of the following conditions checks available free space in avail list --> Avail=Null
internal sorting-->(input data can be adjhusted in main memory)--> ex. Insertion sort,
Bubble sort, Quick sort, Shell sort, , Heap sort ( also called as Tree Sort )
A. Insertion sort
B. Heap sort
C. Bubble sort
D. Quick sort
Sorting a file F usually refers to sorting F with respect to a particular key called..--> Primary
key
The time complexity of quick sort is........best ->O(n logn), worst ->O(n power 2), avg
->O(n logn)
Selection sort first finds them .....Smallest element..... in the list and put it in the first
position.
sorting algorithm is of divide and conquer type--> Quick sort, merg sort, Selection sort
algorithm which are not of divide and conquer type--> Heap sort , Bubble sort, Insertion
sort
If the given input array is sorted or nearly sorted, which algorithm gives the best
performance? --> Insertion sort
Merging k sorted tables into a single sorted table is called..... > k way merging
The function used to modify the way of sorting the keys of records is called...... Hash
function
If the number of record to be sorted large and the key is short, then ....Radix.. sorting can
be efficient.
If the number of record to be sorted large and the key is long, then ....Quick.. sorting can be
efficient.
If the number of records to be sorted is small, then ...Selection... sorting can be efficient.
....Insertion.... Sorting algorithm is frequently used when n is small where n is total number
of elements.
(if in options there is given Insertion sort and Selection sort then correct option is
Insertion sort, if either of them is given then it is correct)
The complexity of sorting algorithm measures the .... running time.. as a function of the
number n of items to be sorted.
🗸 i) Internal sorting are applied when the entire collection if data to be sorted is small
enough that the sorting can take place within main memory.
X ii) The time required to read or write is considered to be significant in evaluating the
performance of internal sorting
Q) ............order is the best possible for array sorting algorithm which sorts n item.
A. O(n logn)
B. O(n2)
C. O(n+logn) 🗸
D. O(logn)
A pointer variable which contains the location at the top element of the stack is called.... Top
When does Top value of stack change in insertion process?-->Before insertion
Reversing a great deal of space for each stack in memory will........> Decrease the numbers
of times overflow may occur.
*********************************************************************
In linked list implementation of queue, if only front pointer is maintained, which of the
following operation take worst case linear time? --> Both Insertion and To empty a queue
In linked list implementation of a queue, front and rear pointers are tracked. Which of these
pointers will change during an insertion into a NONEMPTY queue? --> Only rear pointer
In linked list implementation of a queue, front and rear pointers are tracked. Which of these
pointers will change during an insertion into EMPTY queue? --> Both front and rear pointer
In linked list implementation of a queue, the important condition for a queue to be empty
is?
Which of the following is true about linked list implementation of queue? --> In push
operation, if new nodes are inserted at the beginning of linked list, then in pop operation,
nodes must be removed from end. or -->In push operation, if new nodes
are inserted at the end, then in pop operation, nodes must be removed from the beginning
Priority queue can be implemented using an array, a list, a binary search tree or a heap,
although the most efficient one being the heap.
- Huffman codes,
A dequeue or a double ended queue is a queue with insert/delete defined for both front
and rear ends of the queue.
What is the space complexity for deleting a linked list --> O(1) --> bcos space of
deleting member is 1 unit so ans is c --> O(1)
***************************************************************************
Nodes that are not root and not leaf are called as internal nodes
[Q] Any node is the path from the root to the node is called
iv) In strictly binary tree, the outdegree of every node is either o or 2. → true
v) Network is a graph that has weights or costs associated with it. → true
vi) An undirected graph which contains no cycles is called a forest. → true
A ………Directed tree …… is an acyclic digraph, which has only one node with indegree 0,
and other nodes have indegree 1.
……Binary tree …. Is a directed tree in which outdegree of each node is less than or equal
to two.
A directed graph is Strongly Connected if there is a path from each vertex to every other
vertex in the digraph.
In the ………Depth First …….. traversal we process all of a vertex’s descendents before we
move to an adjacent vertex
A graph is said to be ………Bipartite ……… if the vertices can be split into two sets V1 and
V2 such there are no edges between two vertices of V1 or two vertices of V2.
A graph is a collection of nodes, called ……vertices …. And line segments called arcs or
……edges ….. that connect pair of nodes.
A ……Network or Weighted graph ….. is a graph that has weights of costs associated with
its edges.
.....Garbage collection ..... may take place only when there is some minimum amount (or)
no space left in free storage list.
Q) Trees are said .......... if they are similar and have same contents at corresponding
nodes
Every node N in a binary tree T except the root has a unique parent called the
.....Predecessor .... of N.
While converting binary tree into extended binary tree, all the original nodes in binary
tree are....... Internal nodes on extended tree
In a binary tree, certain null entries are replaced by special pointers which point to nodes
higher in the tree for efficiency. These special pointers are called........ Thread
A binary tree whose every node has either zero or two children is called.........Extended
binary tree or Strict binary tree or Full binary tree
The post order traversal of a binary tree is DEBFCA. Find out the pre order Traversal. →
ABDECF
Q) In linked representation of Binary trees LEFT[k] contains the .....Data ... of at the node
N, where k is the location
The line drawn from a node N of tree T to a successor is called ...... Edge
A. 1 B. 0 C. -1 D. Null
In threaded binary tree .....Threads .... points to higher nodes in tree
A graph is said to be ...Complete .... if every node u in G is adjacent to every other node v
in G.
Graph G is ......Unliterally connected ........ if for any pair u, v of nodes in G there is a path
from u to v or path from v to u.
A connected graph T without any cycles is called ...free graph or acyclic graph.…
D. both b and c
A. End points of e
B. Adjacent nodes
C. Neighbours
FOREST: