Consider a directed graph G = {V, E} with vertex set V = {A, B, C, D} and edge set E = {AB, AC, BC, BD, DC}. Which of the following is a valid topological ordering of graph G?

This question was previously asked in
HTET PGT Official Computer Science Paper - 2019
View all HTET Papers >
  1. ABCD
  2. BACD
  3. BADC
  4. ABDC

Answer (Detailed Solution Below)

Option 4 : ABDC
Free
HTET TGT (Level 2): Science Mock Test
4.6 K Users
10 Questions 10 Marks 8 Mins

Detailed Solution

Download Solution PDF
  • The topological sorting for a directed acyclic graph is the linear ordering of vertices. For every edge U-V of a directed graph, the vertex u will come before vertex v in the ordering.
  • The first vertex in topological sorting is always a vertex with in-degree as 0 (a vertex with no incoming edges.

Diagram

F1 Raju.S 10-11-20 Savita D1

Therefore, the topological ordering of the given graph is ABDC

Topological sort can be performed in the time since depth-first search takes O(V + E)‚ time and it takes O(1) time to insert each of the |V| vertices onto the front of the linked list

Latest HTET Updates

Last updated on Jul 22, 2025

-> HTET Admit Card 2025 has been released on its official website.

-> HTET PGT Admit Card 2025 has been released on the official website.

-> HTET PRT Admit Card 2025 has been released at bseh.org.in

-> HTET Exam Date is out. HTET Level 1 and 2 Exam will be conducted on 31st July 2025 and Level 3 on 30 July

-> Candidates with a bachelor's degree and B.Ed. or equivalent qualification can apply for this recruitment.

-> The validity duration of certificates pertaining to passing Haryana TET has been extended for a lifetime.

-> Enhance your exam preparation with the HTET Previous Year Papers.

->  HTET Admit Card 2025 has been released on its official site

More Graph Search Questions

More Graphs/Spanning Tree and Shortest Paths Questions

Get Free Access Now
Hot Links: teen patti gold old version teen patti master game teen patti real cash apk teen patti game - 3patti poker teen patti gold real cash