您的位置:学习中国 电脑维护 维护工具 正文
原作者:www 添加时间:2007-12-16 原文发表:2007-12-16 人气:824 来源:www

本文章共15679字,分29页,当前第25页,快速翻页:
 
-----------------------------------------------------------------------------------------------------------------------------------------------

本文提示:《C/C++ 笔试、面试题目大汇总(25)》是本站编辑们为广大网友精选的实用文章,本文阐述了关于文章的相关理论,相对来说专业性强,但是本文只是针对于某个问题提出的见解与论述,未必能辐射到相关问题的方方面面,所以本文处理问题的方法仅仅为您提供一些参考。更多问题请查阅学习中国网其他栏目哦.

-----------------------------------------------------------------------------------------------------------------------------------------------


{
if ( p1->data <= p2->data )
{
pcurrent->next = p1 ;
pcurrent = p1 ;
p1 = p1->next ;
}
else
{
pcurrent->next = p2 ;
pcurrent = p2 ;
p2 = p2->next ;
}
}
if ( p1 != NULL )
pcurrent->next = p1 ;
if ( p2 != NULL )
pcurrent->next = p2 ;
return head ;
}
(3)已知两个链表head1 和head2 各自有序,请把它们合并成一个链表依然有序,这次要求用递归方法进行。 (Autodesk)
答案:
Node * MergeRecursive(Node *head1 , Node *head2)
{
if ( head1 == NULL )
return head2 ;
if ( head2 == NULL)
return head1 ;
Node *head = NULL ;
if ( head1->data < head2->data )
{
head = head1 ;
head->next = MergeRecursive(head1->next,head2);
}
else
{
head = head2 ;
head->next = MergeRecursive(head1,head2->next);
}
return head ;
}

41. 分析一下这段程序的输出 (Autodesk)
class B
{
public:
B()
{
cout<<"default constructor"<<endl;
}
~B()
{
cout<<"destructed"<<endl;
}
B(int i):data(i)    //B(int) works as a converter ( int -> instance of  B)
 

本文章更多内容<<上一页 - 1 - 2 - 3 - 4 - 5 - 6 - 7 - 8 - 9 - 10 - 11 - 12 - 13 - 14 - 15 - 16 - 17 - 18 - 19 - 20 - 21 - 22 - 23 - 24 - 25 - 26 - 27 - 28 - 29 - 下一页>>
本页地址
相关文章

解答一道传说是北大计算机面试的题目
计算机毕业 应聘面试题目大全
微软的招聘智力题(考考你自己)
收藏微软面试智力题 (附答案)
46家中外知名企业面试题目
面试考题大全
常见面试题目解析
IBM面试:以一个杯子即兴发挥
这些“怪题”20分钟考翻学子
用人单位以貌取人还出怪题

相关评论


本文章所属分类:首页 电脑维护 维护工具   维护工具