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.

16 lines
835 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(空间大小)
hw2_1:
在SeqList.h中编写OrderInsert()函数。
OrderInsert()函数实现在有序顺序表中
按数据元素非递减的顺序插入一个数据元素item
使得L中的数据元素按值非递减有序序列。
并统计算法中元素移动的次数、元素值比较的次数和使用辅助空间的字节数。
hw2_3:
在SeqList.h中编写MoreRemoveT &x函数。
顺序表中可能有重复的x值。
MoreRemoveT &x函数实现在有序顺序表中删除所有值为x的元素。
尽可能算法高效,考虑减少元素移动的次数。