当前位置: > 设计算法以删除顺序表中重复的元素,并分析算法的时间性能...
题目
设计算法以删除顺序表中重复的元素,并分析算法的时间性能

提问时间:2021-03-15

答案
时间复杂度为O(N)
int sorted_array[N];
int result_index = 0;
int source_index = 0;
int result_len = 0;
for (int source_index = 1; source_index < N; source_index ++)
{
if (sorted_array[source_index] == sorted_index[result_index])
continue;
result_index ++;
}
result_len = result_index + 1;
举一反三
已知函数f(x)=x,g(x)=alnx,a∈R.若曲线y=f(x)与曲线y=g(x)相交,且在交点处有相同的切线,求a的值和该切线方程.
我想写一篇关于奥巴马的演讲的文章,写哪一篇好呢?为什么好
奥巴马演讲不用看稿子.为什么中国领导演讲要看?
想找英语初三上学期的首字母填空练习……
英语翻译
版权所有 CopyRight © 2012-2019 超级试练试题库 All Rights Reserved.