ocr: Algorithm for topologscal sort Input: a set of ordered pairs that represents a partial order. Dutput: a total order in which the partial order is embeaded. Data structures Assune a dictionary of itens to be sorted. Must be able to store with cach iten the number of its predecessors and a pointer to a linked list of its successors in the partial order. Based on algorithm given in Data Structures and *CP Programs, C.J. Van Hyk initialize data structures For Each ordered pair (a, b) in the input Add 1 to b's count of predecessors Add b to a's list of successors - End For Enqueue each item that ha ...