DSA Unit 3, 4, 5 Flashcards
Define spanning tree
subset of graph G where vertices connected using minimum possible number of edges
Justification of Array|Linked
Space efficiency (array could have many unused indices)
Dynamic size (adding or removing nodes frequently)
Traversal flexibility (without worrying about structure of array )
Advantages and disadvantages of TBT
Efficient traversal
Space utilization
No stack Overhead
Faster Access
complex implementation
increased memory usage for every node
Applications of MST
Image processing
Network design
Game development
Electric circuit
Define Stack
Linear abstract data structure
LIFO principle
Types of stack
Implicit - not implemented by user
Explicit - user implemented
Stack Operations
Push
Pop
Peek
isFull
isEmpty
display
Define Queue
Linear abstract data structure
FIFO principle
Types of Queue
Simple
Circular
Priority Queue (Ascending and Descending)
Define Graph
Non Linear Data structure using vertices (fundamental units) and edges (connections)
Operations on Graph
Insert, Delete, Search, and Traverse
Graph traversal methods
BFS (2 queues: Neighbour and Visited)
DFS (adjacent visits)
Kruskal and Prim time complexity
O( |E|log|E| )
Greedy Algorithm
paradigm that builds a solution by choosing pieces with greed (immediate benefit)
Define Tree
Tree is a hierarchical data sturcture where data arranged in multiple levels