7-4 Dijkstra Sequence (30 分)Dijkstra's algorithm is one of the very famous greedy algorithms. It is used for solving the single source shortest path problem ...
7-3 Postfix Expression (25 分)Given a syntax tree (binary), you are supposed to output the corresponding postfix expression, with parentheses reflecting the p...
7-2 Merging Linked Lists (25 分)Given two singly linked lists L1 = a1→a2→⋯→an−1→an and L2 = b1→b2→⋯→bm−1→bm . If n≥2m, you are supposed to reverse and m...
7-1 Forever (20 分)"Forever number" is a positive integer A with K digits, satisfying the following constrains:the sum of all the digits of A is m;the sum of ...
D Is It A Red-Black Tree (30 分)There is a kind of balanced binary search tree named red-black tree in the data structure. It has the following 5 properties:(...