recursive function
recursive function
项目类别:计算机

Hello, dear friend, you can consult us at any time if you have any questions, add  WeChat:  zz-x2580

SampleProblem

 Task 3: Add a recursive function, printReverseList, that will print the elements of the linked list in the reverse order, without changing thelist.

LinkedList: In this question, you have been provided with an incomplete code for a Dynamic Linked List. Your task is to complete the code by adding some functionalities to the program. Before describing the tasks, read the following initial notes, that show some differences between the linked list program we saw in the course and the one you are going to develop in this question:

Initial Notes:  

Tasks: 

Note that in both functions above, you must update the starting and ending pointers, when needed.

To fulfill the above tasks, you must complete the C program, LinkedList.c, that is provided for you.

*Note: You should first CAREFULLY READ THE COMMENTSprovided for each part of the program, and then start completing it.

*Note: DO NOT ALTER/DELETE any part of the existing code. ONLY complete the incompleteparts.

Sample execution of the program:  

Enter your choice:

1to add a new element to the beginning of the

2to add a new element to the end of the

3to print the list in the reverse

4to reverse the list,in-place.

5to merge two ordered lists into a new ordered

6to end

? 1

Enter an integer number: 14 The list is:

14 –> NULL

Enter your choice:

1to add a new element to the beginning of the

2to add a new element to the end of the

3to print the list in the reverse

4to reverse the list,in-place.

5to merge two ordered lists into a new ordered

6to end

? 1  

Enter an integer number: 23 The list is:

23 –> 14 –> NULL

Enter your choice:

1to add a new element to the beginning of the

2to add a new element to the end of the

3to print the list in the reverse

4to reverse the list,in-place.

5to merge two ordered lists into a new ordered

6to end

? 2

Enter an integer number: 41 The list is:

23 –> 14 –> 41 –> NULL

Enter your choice:

1to add a new element to the beginning of the

2to add a new element to the end of the

3to print the list in the reverse

4to reverse the list,in-place.

5to merge two ordered lists into a new ordered

6to end

留学ICU™️ 留学生辅助指导品牌
在线客服 7*24 全天为您提供咨询服务
咨询电话(全球): +86 17530857517
客服QQ:2405269519
微信咨询:zz-x2580
关于我们
微信订阅号
© 2012-2021 ABC网站 站点地图:Google Sitemap | 服务条款 | 隐私政策
提示:ABC网站所开展服务及提供的文稿基于客户所提供资料,客户可用于研究目的等方面,本机构不鼓励、不提倡任何学术欺诈行为。