Indian National Olympiad in Informatics (INOI)

Description: The Indian National Olympiad in Informatics (INOI) is a competitive programming contest held annually in India for school students. It is organized by the Indian Association for Research in Computing Science (IARCS). The contest is open to students of classes 8 to 12 who are citizens of India. The top performers in the INOI are selected to represent India at the International Olympiad in Informatics (IOI).
Number of Questions: 15
Created by:
Tags: computer science programming olympiad
Attempted 0/15 Correct 0 Score 0

What is the maximum number of edges in a tree with n vertices?

  1. n

  2. n-1

  3. n+1

  4. 2n


Correct Option: B
Explanation:

A tree is a connected graph with no cycles. The maximum number of edges in a tree with n vertices is n-1, because if there were n edges, then there would be a cycle.

What is the time complexity of the bubble sort algorithm?

  1. O(n log n)

  2. O(n^2)

  3. O(n)

  4. O(log n)


Correct Option: B
Explanation:

The bubble sort algorithm compares each pair of adjacent elements in the list and swaps them if they are in the wrong order. This process is repeated until no more swaps are needed. The worst-case time complexity of the bubble sort algorithm is O(n^2), which occurs when the list is already sorted in reverse order.

What is the data structure that is used to implement a stack?

  1. Queue

  2. Array

  3. Linked list

  4. Tree


Correct Option: B
Explanation:

A stack is a data structure that follows the Last In First Out (LIFO) principle, meaning that the last element added to the stack is the first one to be removed. The most common way to implement a stack is using an array, where the elements are stored consecutively in memory and the top of the stack is always at the end of the array.

What is the minimum number of colors needed to color a map so that no two adjacent regions have the same color?

  1. 3

  2. 4

  3. 5

  4. 6


Correct Option: B
Explanation:

The Four Color Theorem states that any map can be colored using only four colors so that no two adjacent regions have the same color. This theorem was first proposed by Francis Guthrie in 1852 and was finally proven in 1976 by Kenneth Appel and Wolfgang Haken.

What is the name of the algorithm that is used to find the shortest path between two vertices in a weighted graph?

  1. Dijkstra's algorithm

  2. Bellman-Ford algorithm

  3. Floyd-Warshall algorithm

  4. Kruskal's algorithm


Correct Option: A
Explanation:

Dijkstra's algorithm is a greedy algorithm that is used to find the shortest path between two vertices in a weighted graph. The algorithm works by maintaining a set of visited vertices and a set of unvisited vertices. At each step, the algorithm selects the unvisited vertex with the smallest distance from the starting vertex and adds it to the set of visited vertices. The algorithm then updates the distances of all the unvisited vertices that are adjacent to the newly visited vertex.

What is the name of the data structure that is used to implement a priority queue?

  1. Heap

  2. Queue

  3. Array

  4. Linked list


Correct Option: A
Explanation:

A priority queue is a data structure that maintains a collection of elements and allows the retrieval of the element with the highest priority. The most common way to implement a priority queue is using a heap, which is a binary tree where each node is greater than or equal to its children. The element with the highest priority is always at the root of the heap.

What is the name of the algorithm that is used to find the maximum flow in a network?

  1. Ford-Fulkerson algorithm

  2. Edmonds-Karp algorithm

  3. Dinic's algorithm

  4. Push-relabel algorithm


Correct Option: A
Explanation:

The Ford-Fulkerson algorithm is a greedy algorithm that is used to find the maximum flow in a network. The algorithm works by finding an augmenting path, which is a path from the source vertex to the sink vertex that has a positive residual capacity. The algorithm then sends a flow along the augmenting path and updates the residual capacities of the edges in the network. The algorithm terminates when there are no more augmenting paths.

What is the name of the algorithm that is used to find the minimum spanning tree of a weighted graph?

  1. Kruskal's algorithm

  2. Prim's algorithm

  3. Dijkstra's algorithm

  4. Bellman-Ford algorithm


Correct Option: A
Explanation:

Kruskal's algorithm is a greedy algorithm that is used to find the minimum spanning tree of a weighted graph. The algorithm works by maintaining a set of connected components and a set of edges. At each step, the algorithm selects the edge with the smallest weight that connects two different connected components and adds it to the set of edges. The algorithm terminates when all the vertices are connected.

What is the name of the algorithm that is used to find the shortest path between two vertices in an unweighted graph?

  1. Breadth-first search

  2. Depth-first search

  3. Dijkstra's algorithm

  4. Bellman-Ford algorithm


Correct Option: A
Explanation:

Breadth-first search is an algorithm that is used to find the shortest path between two vertices in an unweighted graph. The algorithm works by maintaining a queue of vertices to visit. At each step, the algorithm dequeues a vertex from the queue and visits all of its unvisited neighbors. The algorithm terminates when the destination vertex is found.

What is the name of the algorithm that is used to find the strongly connected components of a directed graph?

  1. Kosaraju's algorithm

  2. Tarjan's algorithm

  3. Floyd-Warshall algorithm

  4. Kruskal's algorithm


Correct Option: A
Explanation:

Kosaraju's algorithm is a linear-time algorithm that is used to find the strongly connected components of a directed graph. The algorithm works by performing two depth-first searches on the graph. The first depth-first search is performed on the original graph, and the second depth-first search is performed on the transpose of the graph.

What is the name of the algorithm that is used to find the maximum independent set of a graph?

  1. Greedy algorithm

  2. Dynamic programming

  3. Branch and bound

  4. Backtracking


Correct Option: A
Explanation:

A greedy algorithm is a simple and efficient algorithm that makes a locally optimal choice at each step in the hope of finding a globally optimal solution. A greedy algorithm for finding the maximum independent set of a graph works by repeatedly selecting the vertex with the maximum degree and adding it to the independent set. The algorithm terminates when there are no more vertices that can be added to the independent set.

What is the name of the algorithm that is used to find the minimum vertex cover of a graph?

  1. Greedy algorithm

  2. Dynamic programming

  3. Branch and bound

  4. Backtracking


Correct Option: A
Explanation:

A greedy algorithm for finding the minimum vertex cover of a graph works by repeatedly selecting the vertex with the maximum degree and adding it to the vertex cover. The algorithm terminates when all the edges in the graph are covered by the vertex cover.

What is the name of the algorithm that is used to find the Hamiltonian cycle in a graph?

  1. Greedy algorithm

  2. Dynamic programming

  3. Branch and bound

  4. Backtracking


Correct Option: D
Explanation:

A backtracking algorithm for finding the Hamiltonian cycle in a graph works by recursively exploring all possible paths from the starting vertex. At each step, the algorithm selects a vertex that has not been visited yet and adds it to the path. If the path reaches the starting vertex again, then it is a Hamiltonian cycle. The algorithm terminates when all possible paths have been explored.

What is the name of the algorithm that is used to find the shortest path between two vertices in a directed graph with negative weights?

  1. Dijkstra's algorithm

  2. Bellman-Ford algorithm

  3. Floyd-Warshall algorithm

  4. Kruskal's algorithm


Correct Option: B
Explanation:

The Bellman-Ford algorithm is a dynamic programming algorithm that is used to find the shortest path between two vertices in a directed graph with negative weights. The algorithm works by iteratively relaxing all the edges in the graph. At each iteration, the algorithm updates the distance of each vertex to the starting vertex. The algorithm terminates when there are no more edges that can be relaxed.

What is the name of the algorithm that is used to find the maximum bipartite matching in a graph?

  1. Greedy algorithm

  2. Dynamic programming

  3. Branch and bound

  4. Backtracking


Correct Option: A
Explanation:

A greedy algorithm for finding the maximum bipartite matching in a graph works by repeatedly selecting the edge with the maximum weight and adding it to the matching. The algorithm terminates when there are no more edges that can be added to the matching.

- Hide questions