0% found this document useful (0 votes)
121 views

Data Structure's Notes: (Amit Anwade - AIR-142)

- The document provides information on preparation strategies for exams including coding practice websites and reading notes. - It also contains a collection of data structure concepts and questions related to linked lists, stacks, queues, sorting, and trees. Key concepts covered include run lists, sentinels, dequeuing, indexing in linked lists, and singly, doubly, circular, and header linked lists.

Uploaded by

rohit
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
121 views

Data Structure's Notes: (Amit Anwade - AIR-142)

- The document provides information on preparation strategies for exams including coding practice websites and reading notes. - It also contains a collection of data structure concepts and questions related to linked lists, stacks, queues, sorting, and trees. Key concepts covered include run lists, sentinels, dequeuing, indexing in linked lists, and singly, doubly, circular, and header linked lists.

Uploaded by

rohit
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 10

My Preparation Strategy :

- Code With Harry (must)


- sunbeam class book thoroughly
- sanfoundry.com for MQC preparation
- Google

Data Structure's notes


link [Amit Anwade(Civil Engineer)-AIR-142]
Click here to join telegram group for more notes

 -> A run list is......small batches of records from a file

 -> 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

 -> A doubly linked list has ..........

3 fileds, namely--> previous, data and next

2 pointers with each node --> previous and next

 -> 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

 -> Two-way list may be maintained in memory by means of.....Linear arrays.......

 -> 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

 -> Q) Which of the following is two way lists?


A. Grounded header list B. Circular header list

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.

 -> RLINK is the pointer pointing to the...> successor node

 -> LLINK is the pointer pointing to the...> predecessor node

3 fields of linked list ,,,,,,,,, LLINK <<----- data ---->> RLINK

 -> A ......circular header list....... is a header list where the last node points back to the header
node.

 Q) The disadvantage in using a circular linked list is .......

🗸 A. it is possible to get into infinite loop 🗸

B. last node points to fist node.

C. time consuming

D. requires more memory space.(actually it enables efficient use of memory)

 doubly linked list requires more memory space.

 Which of the following conditions checks available free space in avail list --> Avail=Null

 Finding the location of a given item in a collection of items is called......Searching

 external sorting-->-->(input data cannot be adjhusted in main memory entirely at once so


need other store medium to store) -->> ex. Merge Sort

 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 )

 Q) Very slow way of sorting is..........(ans depends on time complexity)

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.

 Quick sort is also known as........partition and exchange sort.

 A tree sort is also known as ...... heap... sort.

 ....Radix.. sorting is good to use when alphabetizing large list of names.

 The easiest sorting is........selection sort

 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

 merg sort -->not an in-place sorting algorithm-->(stable sorting algorithm)--> application


-> data processing

 not a stable sorting algorithm--> Selection 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 total number of comparisons in a bubble sort is ... O(n logn)

 The complexity of sorting algorithm measures the .... running time.. as a function of the
number n of items to be sorted.

 Q) Sorting algorithm can be characterized as......

A. Simple algorithm which require the order of n2 comparisons to sort n items.

B. Sophisticated algorithms that require the O(nlog2n) comparisons to sort items.

C. Both of the above

 Q) State True or False for internal sorting algorithms.

🗸 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)

 ......Radix sort...... is the method used by card sorter.

 Q) What happens when you push a new node onto a stack?

🗸 A. The new node is placed at the front of the linked list

B. The new node is placed at the back of the linked list

C. The new node is placed at the middle of the linked list

 The elements are removal from a stack in .....Reverse..... order.

 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

 (Q) Deletion in the linked stack takes place by deleting........

A. Node pointed by the start process. 🗸

B. End of the list C. Beginning of the list D. Middle of the list

 The condition........ Indicate the queue is empty.--> Front=Null

 The term dequeue is the contraction of the name........Double ended queue

 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?

a) FRONT is null b) REAR is null c) LINK is empty d) FRONT==REAR-1

Explanation: Because front represents the deleted nodes.

 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.

 application of priority queue-->

- Huffman codes,

- Interrupt handling in operating system


- Bayesian spam filter

 A dequeue or a double ended queue is a queue with insert/delete defined for both front
and rear ends of the queue.

 What are the applications of dequeue?

- A-Steal job scheduling algorithm

- Can be used as both stack and queue

- To find the maximum of all sub arrays of size k

-To avoid collision in hash tables

 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)

***************************************************************************

 [Q] The property of binary tree is

A) The first subset is called left subtree

B) The second subtree is called right subtree

C) The root cannot contain NULL

D) The right subtree can be empty

 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

A) Successor node B) Ancestor node C) Internal node D) None of


the above

 State true of false.

i) A node is a parent if it has successor nodes. → True

ii) A node is child node if out degree is one. → false

iii) An empty tree is also a binary tree.→ true

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.

 Binary trees with threads are called as...... Threaded trees

 Q) In Binary trees nodes with no successor are called......

A. End nodes B. Terminal nodes C. Final nodes D. Last nodes

 Q) Trees are said .......... if they are similar and have same contents at corresponding
nodes

A. Duplicate B. Carbon copy C. Replica D. Copies

 if node data/value is repeated then it is called as Duplicate node

 Every node N in a binary tree T except the root has a unique parent called the
.....Predecessor .... of N.

 Sequential representation of binary tree uses....... Array with pointers

 Q) TREE[1]=NULL indicates tree is ........


A. Overflow B. Underflow C. Empty D. Full

 Linked representation of binary tree needs .....3.... parallel arrays.

i.e. needs 3 fileds, namely--> previous, data and next

 In a 2-tree, nodes with 0 children are called.......External node .....

 In a extended-binary tree nodes with 2 children are called........ Internal node

 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

A. Data B. Location and left child C. Right child address D. Null


value

 Q) Three standards ways of traversing a binary tree T with root R .......

A. Prefix, infix, postfix

B. Pre-process, in-process, post-process

C. Pre-traversal, in-traversal, post-traversal

D. Pre-order, in-order, post-order

 The line drawn from a node N of tree T to a successor is called ...... Edge

 In a binary tree a sequence of consecutive edges is called ...... Path

 The root R of the binary tree is assigned a level number of ......

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.

 A graph is said to be ....Lebeled ... if its edges are assigned data.

 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.…

 Size of graph → total number of edges in graph

 Q) A connected graph T without any cycles is called a ........

A. A tree graph B. Free tree C. A tree d D. All of the above

 Q) In a graph if E=(u,v) means ......

A. u is adjacent to v but v is not adjacent to u

B. e begins at u and ends at v

C. u is processor and v is successor

D. both b and c

 Q) In a graph if e=[u,v], Then u and v are called ........

A. End points of e

B. Adjacent nodes

C. Neighbours

D. All of the above

 AVL tree → It is a self balancing tree with height difference atmost 1.

 Q) Why we need to a binary tree which is height balanced?


a) to avoid formation of skew trees (bcos which gives worst case)
b) to save memory
c) to attain faster memory access
d) to simplify storing
 What is the maximum height of an AVL tree with p nodes → O(log p) as worst case
height

 FOREST:

->A Forest is an undirected graph, all of whose components are trees.

->In another words, the graph consists of a disjoint union of trees.

->Equivalently, a forest is an undirected cycle free graph.

You might also like