tailieunhanh - A Laboratory Course in C++Data Structures phần 10

Bạn có thể đại diện cho một đồ thị theo nhiều cách. Trong phòng thí nghiệm này, bạn sẽ sử dụng một mảng để lưu trữ các thiết lập của đỉnh và một ma trận kề để lưu trữ các thiết lập của các cạnh. Một entry (j, k) trong một ma trận kề chứa thông tin về | 370 Laboratory B Test Plan for the heapSort Operation Test Case Array Expected Result Checked Heap ADT 371 Laboratory B In-lab Exercise 3 Name Date Section__ Examining the tree form of a heap rotated 90 degrees counterclockwise from its conventional orientation can be awkward. Because a heap is a complete tree an unambiguous representation in tree form can be generated by outputting the heap level by level with each level output on a separate line. void writeLevels const Requirements None Results Outputs the data items in a heap in level order one level per line. Only outputs each data item s priority. If the heap is empty then outputs Empty heap . The tree shown on the first page of this laboratory for example yields the following output. 93 82 64 27 75 39 18 Step 1 Implement this operation and add it to the file . A prototype for this operation is included in the declaration of the Heap class in the file . Step 2 Activate the W write levels command in the test program in the file by removing the comment delimiter and the character W from the lines that begin with W . Step 3 Prepare a test plan for this operation that covers heaps of various sizes including empty and single-data item heaps. A test plan form follows. Step 4 Execute your test plan. If you discover mistakes in your implementation of the writeLevels operation correct them and execute your test plan again. 372 Laboratory B Test Plan for the writeLeveis Operation Test Case Commands Expected Result Checked

TỪ KHÓA LIÊN QUAN