1、1精2精学生课程学习工程图学生课程学习工程图C8C3C5C4C9C6C7C1C23精4精5精C8C3C5C4C9C6C7C1C26精 7精C0C1C2C3C4C5(a)有向无环图有向无环图C2C5C1C0C3(b)输出顶点输出顶点C4C1C2C5C3(c)输出顶点输出顶点C0C4C0C2C5C1C3(d)输出顶点输出顶点C38精C1C2C5(e)输出顶点输出顶点C2C5C1(f)输出顶点输出顶点C1C5(g)输出顶点输出顶点C5(h)拓扑排序完成拓扑排序完成9精C0C1C2C3C4C5 C0 C1 C2 C3 0 C4 C5 0012345count data adj 130103 1 des
2、t link 3 0 5 1 5 0 0 1 5 010精建立边结点,dest 域赋为 k链入顶点 j 的边链表的前端顶点入度加一11精12精指向新栈顶 原栈顶元素在中退到次栈顶13精C0C1C2C3C4C513010313112322-112221-1222012345012345012345012345toptoptoptoptoptoptoptop14精C0C1C2C3C4C52112222112212-1-122-12-1-122-1012345012345012345012345toptoptoptoptoptop15精16精17精a9=61324a1=8a2=125678a10=12a8=18a5=28a6=8a7=6a3=14a4=1018精19精20精,),(ijjVVdurjVemaxiVe,),(jijVVdurjVlminiVl21精22精1324a1=8a2=125678a10=12a9=6a8=18a5=28a6=8a7=6a3=14a4=10VeVl1 2 3 4 5 6 7 8 0 8 12 22 28 40 46 58 0 8 12 22 28 40 46 58el0 0 8 12 12 22 22 28 40 460 0 8 12 12 32 22 28 40 461 2 3 4 5 6 7 8 9 1023精24精