慕测平台测试报告(二) 学 院:计算机学院 姓 名:红娜专 业:软件工程 学 号:3130608003 班 级:1301 完成日期:2024-10-222024 年 10 月 22 日1.题目针对以下 4 个项目编写测试用例进行测试。代码如下:题目(1)// BinaryHeap class//// CONSTRUCTION: with optional capacity (that defaults to 100)//// ******************PUBLIC OPERATIONS*********************// void insert( x ) --> Insert x// int deleteMin( )--> Return and remove smallest item// int findMin( ) --> Return smallest item// boolean isEmpty( ) --> Return true if empty; else false// boolean isFull( ) --> Return true if full; else false// void makeEmpty( ) --> Remove all items// ******************ERRORS********************************// Throws Overflow if capacity exceeded/** * Implements a binary heap. * Note that all "matching" is based on the compareTo method. * author Mark AllenWeiss */publicclass BinaryHeap{ // invariant wellFormed(); /** * Construct the binary heap. */public BinaryHeap( ) {this( DEFAULT_CAPACITY ); } /** * Construct the binary heap. * param capacity the capacity of the binary heap. */ // requires capacity > 0; // ensures isEmpty();public BinaryHeap( int capacity ) { currentSize = 0; array = newint[ capacity + 1 ]; } /** * Insert into the priority queue, maintaining heap order. * Duplicates are allowed. * param x the item to insert. * exception Overflow if container is full. */publicvoid insert( int x ) throws Overflow {if( isFull( ) )thrownew Overflow( ); // Percolate upint hole = ++currentSize;for( ; hole > 1 && x< array[ hole / 2 ]; hole /= 2 ) array[ hole ] = array[ hole / 2 ]; array[ hole ] = x; } /** * Find the smallest item in the priority queue. * return the smallest item, or null, if empty. */publicint findMin( ) {if( isEmpty( )...