PIC 10B Homework 5 Due Wednesday, March 10
Problem 1:
Using good coding practices, design your own Linked List of int types. It will consist
of classes List, Node, and Iterator granting friendship and defining functions as needed.
Write constructors, destructors, and all necessary member functions such as insert, erase,
increment and decrement operators, operator* to dereference, as well as operator== and
operator!= to check whether two iterators are pointing to the same element. You will then
use this list to write the following member functions:
(1) List::reverse to reverse your nodes
(2) List::push front to add a value to the beginning of a list
(3) List::sort to sort the elements of a linked list (without copying them into a vector or
another data type)
(4) List::merge which accepts another List object and merges the two lists into one, alternating
elements from each list such that merging 1 7 12 and 8 3 11 2 2 1 yields the list 1
8 7 3 12 11 2 2 1.
Write a main function to test your list such that it follows the output shown in Figure 1.
Figure 1: sample output.
Due Wednesday, March 10 Homework 5 PIC 10B
Good Coding Practices:
• think about cross-platform. Don’t use Windows or Mac only commands. For example,
pause == cin.get() twice, write many \n vs. system(clear) or system(’cls).
• passing objects by reference & or const & when possible
• using field initializer list when possible in all constructors
Instructions for submission:
• Name your files exactly hw5.cpp, List.h, List.cpp, Node.h, Node.cpp, Iterator.h,
and Iterator.cpp.
• You may not use #include "stdafx.h".
• Add code description in the comment at the beginning of the file.
A sample description may look like:
/*
PIC 10B 2A, Homework 1
Purpose: Tic-tac-toe game
Date: 10/10/2019
*/
• Submit your header files and source codes to CCLE in separate files. Only .h and .cpp
files should be uploaded.
当前位置:网站首页>Pic 10B parsing
Pic 10B parsing
2022-06-26 07:46:00 【kjxt6387】
边栏推荐
- JS modularization
- In interface testing, several methods to verify the success of deleting interfaces
- 多传感器融合感知
- Jemter 压力测试 -基础请求-【教学篇】
- How to define a digital factory and what is the relationship with smart factory and industry 4.0
- [NLP] vector retrieval model landing: Bottleneck and solution!
- Encapsulating ranging and surface class based on leaflet
- Pycharm settings
- C implementation adds a progress bar display effect to the specified column of the GridView table in devaxpress - code implementation method
- 2021 project improvement
猜你喜欢

Opencv鼠标事件+界面交互之绘制矩形多边形选取感兴趣区域ROI

B站增量数据湖探索与实践

QTreeWidget And QTableWidget

Yyds dry inventory kubernetes easy service discovery and load balancing (11)

Redis (5) -- Talking about compressed list

Web technology sharing | webrtc recording video stream

Median segmentation (find rules) - Niuke

Teach you how to use the harmonyos local simulator

卡尔曼滤波器_Recursive Processing

数据中心灾难恢复的重要参考指标:RTO和RPO
随机推荐
Golang collaboration and channel usage
What are the characteristics of digital factory in construction industry
Quickly find five channels for high-quality objects, quickly collect and avoid detours
Web technology sharing | webrtc recording video stream
[UVM practice] Chapter 3: UVM Fundamentals (3) field automation mechanism
Power apps application practice | easily develop employee leave attendance management applet with power apps
JS event loop mechanism
JS modularization
[recommend an entity class conversion tool mapstruct, which is powerful and easy to use]
What is the difference between bone conduction earphones and ordinary earphones? Advantages of bone conduction earphones
The first multi platform webcast of 2021ccf award ceremony pays tribute to the winners! CCF outstanding engineer
B站增量数据湖探索与实践
Seven important reasons for responsive Web Design
Which of the top ten securities companies has the lowest commission fee and is the most safe and reliable?
Okhttp3 source code explanation (IV) cache strategy, disadvantages of Android mixed development
buuresevewp
What is Wi Fi 6 (802.11ax)? Why is Wi Fi 6 important?
[North Asia data recovery] a server data recovery method in which the partitions in the RAID5 array are formatted due to the misoperation of the NTFS file system
Google Earth engine (GEE) 02 basic knowledge and learning resources
Jemter stress test - basic requirements - [teaching]