DS Lecture
DS Lecture
DS Lecture
A null pointer is a special pointer value that is known not to point anywhere. It means that no
other valid pointer, to any other variable or array cell or anything else, will ever compare
equal to a null pointer.
Q))
** Advantages and disadvantages of Array?
Advantages: We can put in place of other data structures like stacks, queues, linked lists,
trees, graphs, etc. in Array. Arrays can sort multiple elements at a time. We can access an
element of Array by using an index.
Disadvantages: We have to declare Size of an array in advance. However, we may not
know what size we need at the time of array declaration. The array is a static structure. It
means array size is always fixed, so we cannot increase or decrease memory allocation.
Ternary Tree:- General trees which have 3 sub-trees per node are called ternary trees
IT B QUESTIONSs
1. Basic theory questions he puche the
3. What is hashing
A circular linked list is a variation of a linked list in which the last node
points to the first node, completing a full circle of nodes.
Worst case:
6. Stack
7. Queue
8. Doubly LL
Doubly linked list is a complex type of linked list in which a node contains a
pointer to the previous as well as the next node in the sequence.
9. Linked list
Like arrays, Linked List is a linear data structure. Unlike arrays, linked list
elements are not stored at a contiguous location; the elements are linked
using pointers.
10. Time complexity of AVL tree
O(log2n).
Every binary search tree is a binary tree Every AVL tree is also a binary tree
because both the trees contain the because AVL tree also has the utmost
In BST, there is no term exists, such as In the AVL tree, each node contains a
Every Binary Search tree is not an AVL Every AVL tree is a binary search tree
tree because BST could be either a because the AVL tree follows the
Each node in the Binary Search tree Each node in the AVL tree consists of
consists of three fields, i.e., left subtree, four fields, i.e., left subtree, node value,
node value, and the right subtree. right subtree, and the balance factor.
12. BST KI TE
13. Circular LL
Circular linked list is a linked list where all nodes are connected to form a
circle. There is no NULL at the end. A circular linked list can be a singly
circular linked list or doubly circular linked list.
20. full ,complete BT ,linked list , condition of stack overflow,circular queue, circular
link list
BFS DFS
Full form BFS stands for Breadth First DFS stands for Depth First Search.
Search.
to find the shortest path in a along the edge are explored first from the starting to
24. Kaun sa sort best hai and why – quick sort because iska average and best time
complexity O(n logn) hai.
25. Priority queue – A queue with priority(simple). Here the elements are not in FIFO
manner but according to the priority that is assigned to them.If the elements are in
the same priority ,only than the FIFO principle is followed
The Tower of Hanoi, is a mathematical problem which consists of three rods and
multiple disks. Initially, all the disks are placed on one rod, one over the other in
ascending order of size similar to a cone-shaped tower.
A balanced binary search tree where the height of the two subtrees (children)
of a node differs by at most one.
Binary Search Tree is a node-based binary tree data structure which has the
following properties:
- The left subtree of a node contains only nodes with keys lesser than the
node’s key.
- The right subtree of a node contains only nodes with keys greater than the -
node’s key.
- The left and right subtree each must also be a binary search tree.
- There must be no duplicate nodes.
O(1) Best case happens for right skewed trees in finding the minimum value.
O(log n) .
34. The Tower of Hanoi puzzle with n disks can be solved in minimum 2^n−1 steps.
Stack is used for static memory allocation and Heap for dynamic memory
allocation, both stored in the computer's RAM
37. Bst, one screen shared questions, linked list linear or nonlinear, doubly LL,tower
of hanoi ....3 palte hain to kitne number—- agar 3 disc he to 7 movement karegi* of
step honge tower of hanoi m
hash1(key) = key%SIZE
hash2(key) = PRIME – (key % PRIME)
Row Major
Column Major
Circular queue
Mere se
Circular queue
*B and B+ tree
+1
Complexity
B+ tree
2 logon se
Avl tree
Link list
AVL tree
Stack
Priority queue
Circular queue
Linked list*
Forest tree
What is B+ Tree
Time Complexity of Finding First and Last element in a Right Skewed Binary Tree?
[O(1) and O(n) respectively]
If both Linked list and Binary tree have the same complexity... What's the difference?
Traversing of tree
Avl tree
Circular queue
Circular ll
Complexity avl
Priority queue
Priority queue
AVL trees
Data structures
CS A LAB
🥲
74. bas itna
75. Uske bad sir ka network issue hua, then bole okk your viba completed
76. Insertion sort complexity
77. Graph ka application, graph ka facebook mein use,
78. What is graph
79. Complete binary tree
80. Graph representation (notebook pe graph banane ko bola aur uska adjacency
matrix aur list banao)
81. How to implement tree DS?
82. Tower of Hanoi
83. Stack memory.
84. After deleting the stack element ka kya hota hai? Koi existence rahti Hai?
85. What's hashing?
86. Stack memory
87. how do we balance avl tree
88. what is circular linked list
89. how to insert an element in the middle in circular linked list
90. time complexity of avl tree
91. tower of Hanoi
92. Difference between graph and tree
93. What is queue
94. Overflow condition
95. Circular queue
96. Formula pucha tha circular queue jo class m btaya tha unhone
97. What is binary tree
98. tree vs graph
99. implement tree
100. binary heap?
101. aur yaad nhi aa rha..
102. Graph representation-which one will u prefer when
103. Time comp. and space complexity
104. Graph Representation
105. Ek Graph bnao aur usko Adjacency Matrix se represent kro,
106. What is stack memory and what happened after it got deleted
107. What is hashing
108. Aur bhi kuch tha, yaad nhi
109. AVL tree complexity
110. Tree traversing
111. Graph application
112. Implementation of tree
113. Bubble sort, insertion sort, selection sort worst and best time complexity
114. Prims algo
115. Tree traversal in detail
116. Diff graph vs tree
117. B+ tree kya hota hai
118. Avl tree advantage
119. Krunker's algorithm?
120. What is a graph and traverse it ?
121. How to insert a node in the middle of a circular link list ?
122. Conditions of overflow in queue?
123. What is Stack
124. Avl tree
125. Dfs and bfs
126. Tower of hanoi
127. ADT
128. All AVL Rotation
129. How we represent Graph
130. Graph applications
131. .Linear data structure and non linear data structure with its example
2.prims algorithm 3.what is data structure..application of data
structure 5.Difference between bfs and dfs 6.Quick sort worst
and best time complexity..
132. Draw B+ tree
133. Its applications
134. Diff bw B tree and B+ tree
135. B+ tree me fill kaise karoge
136. Bubble sort complexity in all 3 cases
137. Is merge sort a stable sort
138. Can time complexity be calculated using recursion
139. Graph def
140. Bfs vs DFS
141. How to implement bfs and dfs
142. Completed graph
143. Suppose you are given an undirected graph from A to B in how many way
can you reach that
144. Merge sort complexity and derive it on notebook
145. Hanoi tower
146. Graph traversal
147. Dfs ka example leke kro notebook me
148. Quick sort complexity
149. And Djikstra algo
150. Most ques are from tree and simple uses of graph speak just what you
🙂
know I explained a question using word 'completed graph' he asked me it's
def thank God I had known it
151. Are wo bas tumhara level dekh rahe the kitna tumhe aata hai if you can
answer 5 out of 10 correctly and at least 3 you may say half incorrect or co
relate it and you same face to face that you don't know other 2 then he would
still get good impression
152. He asked me for tree and graph but for sort kuch nahi bataya except time
complex and just said about that I know time complex
153. Derive worst case time complexity of quick sort
154. Prove that a complete graph has n*(n-1)/2 edges
155. What is Kruskal's algorithm
156. What is level in a graph
157. What is ADT
158. What is indegree
159. What is a degree
160. Memory stack?
161. Kruskal's algo
162. Biconnected graph?
163. What is Topological Sorting
164. Heavily connected graph?
165. Weakly connected graph?
166. Advantages of AVL tree
167. Selection, insertion and bubble all case complexities
168. What is a loop
169. What is an undirected acyclic graph?
170. Priority queue application
171. Preprocessor directives
172. Tower of Hanoi
173. How to insert a node in last of circular linked list
174. Minimum spanning tree,
175. Djikstra (pata nahi kya h) algorithm,
176. Linked list or array for stack implementation,
177. Queue overflow condition,
178. level of graph kya hota hai
CSE C LAB
Ek code likhwaya
Pehle pooche dfs aur bfs kaun se ds mein use karte hai phir question change kar
diye aur keh rahe ki ham to pooche the ki dfs aur bfs kaun se ds se implement karte
hai
4.Tournament Tree
5.Kruskal's Algorithm
how to to find the maximum element in a linked list without using conditional operator
B b++ tree
Aur implementation of stack using linked list and using array dono m difference
How to do it ?
Explain it to him ?
Something like ki array and linked list k case m top peek krne pr dono cases m kya
diff hoga to vahi dynamic memory allocation nd all bta k aa gyi m to
4.Tournament Tree
5.Kruskal's Algorithm
Ek code likhwaya
Pehle pooche dfs aur bfs kaun se ds mein use karte hai phir question change kar
diye aur keh rahe ki ham to pooche the ki dfs aur bfs kaun se ds se implement karte
hai
#What sorts are used for non comparison - Radix sort and bucket sort and their
Time complexities
Spanning tree
#Prims algorithm
Spanning tree
#Krushkal algorithm
Nhi aata ho to keh dena nhi aata..kahi se dekh ke mat padhna..unko pata chal ja rha
hai..
#Bucket and radix hoti h ... Best case mai bhi i guess
#Application of queue
#Radix sort
Bucket sort
#Radix sort
#Complexity
[3/1, 14:45] Abhinav Goel: Aur bhi the kuchh ki time complexity of graph
[3/1, 14:45] Abhinav Goel: What sorts are used for non comparison - Radix sort and
bucket sort and their Time complexities
Spanning tree
[3/1, 14:45] Abhinav Goel: Priority queue ig
Nhi aata ho to keh dena nhi aata..kahi se dekh ke mat padhna..unko pata chal ja rha
hai..
Spanning tree
[3/1, 14:45] Abhinav Goel: Bucket and radix hoti h ... Best case mai bhi i guess
[3/1, 14:45] Abhinav Goel: how graph can be implemented ? priority queues ? quick
sort algorithm ?
Bucket sort
[3/1, 14:45] Abhinav Goel: Strictly binary and full binary tree same hote hai na?
[3/1, 14:45] Abhinav Goel: Nahi same nhi hote strictly binary tree me all levels full
hona zaruri nhi... Full binary tree is a strictly binary tree in which all levels are
completely full
[3/1, 14:45] Abhinav Goel: If we have to insert new element in a heap what's the
process
[3/1, 14:45] Abhinav Goel: What is creating graph complexity for adjacency list and
matrix.
[3/1, 14:45] Abhinav Goel: What is the criteria for using bucket sort
[3/1, 14:45] Abhinav Goel: Heaps are used in which data structure
DS THEORY CSE C2
Example of multitasking
Forest
Big O defn
#queue adt
#What is adt ? 🥲
#An abstract data type is a set of operations. ADTs are mathematical abstractions;
now here in
an ADT’s definition is there any mention of how the set of operations is implemented.
Objects such as lists, sets and graphs, along with their operations can be viewed as
abstract
data types.
Heap sort
#Dilishitea algorithm
B vs B+ tree
Asymptotic notation
Counting sort
Bucket sort tc
Asymptotic notation
Shell sort
And why..