You are on page 1of 3

1) Define all the terms in the chapter Graph:

● Graph: A data structure that consists of a finite set of vertices (nodes) and
a set of edges connecting these vertices.
● Vertex/Node: The fundamental unit in a graph, representing a point or an
entity.
● Edge: A connection between two vertices in a graph.
● Directed Graph (Digraph): A graph in which edges have a direction, i.e., an
edge (u, v) doesn't necessarily imply the existence of the reverse edge (v,
u).
● Undirected Graph: A graph in which edges have no direction, i.e., an edge
{u, v} implies the existence of the reverse edge {v, u}.
● Weighted Graph: A graph in which each edge has an associated numerical
value (weight).
● Adjacency Matrix: A two-dimensional matrix where the presence or
absence of an edge between vertices is indicated by 1 or 0, respectively.
● Adjacency List: A collection of linked lists or arrays where each list/array
represents the neighbors of a vertex.
● Cycle: A path in a graph that starts and ends at the same vertex.
● Connected Graph: A graph in which there is a path between every pair of
vertices.
● Disconnected Graph: A graph in which there are at least two vertices for
which no path exists between them.

2) Define all types of sorting:


● Bubble Sort: A simple sorting algorithm that repeatedly steps through the
list, compares adjacent elements, and swaps them if they are in the wrong
order.
● Selection Sort: A sorting algorithm that works by repeatedly selecting the
minimum element from the unsorted portion of the array and putting it at
the beginning.
● Insertion Sort: A simple sorting algorithm that builds the final sorted array
one item at a time by repeatedly taking elements from the input data and
inserting them into their correct position.
● Merge Sort: A divide-and-conquer algorithm that divides the array into two
halves, recursively sorts them, and then merges the sorted halves.
● Quick Sort: Another divide-and-conquer algorithm that works by selecting a
'pivot' element and partitioning the other elements into two sub-arrays
according to whether they are less than or greater than the pivot.
● Heap Sort: A comparison-based sorting algorithm that uses a binary heap
data structure to build a max-heap and then swaps the root (maximum)
element with the last element and rebuilds the heap.

3) Define asymptotic notations:


● Asymptotic Notation: Mathematical notation used to describe the limiting
behavior of a function as its input approaches infinity.
● Big O (O): Represents an upper bound on the growth rate of a function,
i.e., the worst-case scenario.
● Omega (Ω): Represents a lower bound on the growth rate of a function,
i.e., the best-case scenario.
● Theta (Θ): Represents both upper and lower bounds, providing a tight
bound on the growth rate.
● Small O (o): Represents an upper bound that is not tight; the function
grows strictly slower than the bounding function.

4) Examples of asymptotic notations:


● O(n): Linear time complexity.
● Ω(n): Linear lower bound.
● Θ(n^2): Quadratic time complexity.
● o(log n): Logarithmic upper bound.

5) Define all types of notations (big O, Small o, omega, etc.)


with examples:
● Big O (O): Represents the upper bound. Example: O(n^2) - Quadratic time
complexity.
● Small O (o): Represents an upper bound that is not tight. Example: o(n^2) -
Not tightly bounded quadratic time complexity.
● Omega (Ω): Represents the lower bound. Example: Ω(n) - Linear time
complexity.
● Theta (Θ): Represents a tight bound, both upper and lower. Example: Θ(n
log n) - Linearithmic time complexity

6) Ceiling value, floor value:


● Ceiling Value: The smallest integer greater than or equal to a given real
number.
● Floor Value: The largest integer less than or equal to a given real number.
● .

7) Notes pe refer kare

You might also like