1
0
Fork 0
You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

10 lines
601 B
Plaintext

This file contains ambiguous Unicode characters!

This file contains ambiguous Unicode characters that may be confused with others in your current locale. If your use case is intentional and legitimate, you can safely ignore this warning. Use the Escape button to highlight these characters.

统计算法中元素移动的次数: 每次移动时调用 counter.inc_mov(移动次数)
统计算法中元素比较的次数: 每次比较时调用 counter.inc_cmp(比较次数)
统计算法中辅助空间的大小: 每次申请时调用 counter.inc_mem(空间大小)
hw3_2:
实现LinkedList::Merge
将有序单链表La和Lb归并为表*this
且表*this按照值从小到大有序。
要求3个单链表La,Lb,*this每个结点被访问一次且仅被访问一次。算法尽可能高效。
并统计算法中元素移动的次数、元素值比较的次数和使用辅助空间的字节数。