Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

BF 1 3 Di giv MySinglyList.h f wan klas as d n sho na di UML klas dayagram d ya . MiSinglyList we

BF13"Di giv MySinglyList.h f wan klas as dn sho na di UML klas dayagram d ya."
MiSinglyList we a de du
- sLL : Na wan wan List
+ MiSingliList ()
+ chkSt da () : bool
+ addValue(valyu: dbul) : void
+ insertNodeWith888(valyu: dbul) : void
+ muvLastNodeToBigin() : Node*
+ displayList () : n gt nitin f du wit am
4. Ad wan ss fayl to yu prjek, we dn kl MySinglyList.cpp n impruv l di mmba
fnshn d\epsi m akdin to di diskripshn we de dn:
a. sLL na wan bjkt we gt tayp SinglyList.
ii. MySinglyList() na diflt knstrkta f initialize sLL bay we yu insay wan nmba f no dn insay am as
we de fala:
1. Insayt valyu 3.8 to pozishn 0.
2. Insayt valyu 4.6 to pozishn 1.
3. Insayt valyu 0.2 to pozishn 2.
4. Insayt valyu 9.1 to pozishn 3.
Afta dis, kl displayList() fnshn f sho di list.
iii. checkSortedOrder() na wan knstant mmba fnshn we de chk if di data na di sLL de insay
da we dn dn st (da we de go p). If na so, i de kam bak tru, lay dasay.
iv. addValue(double) na mmba fnshn we de ad wan givn valyu to vri node data na sLL.
v. insertNodeWith888(double) na mmba fnshn we de insay nyu node we gt di
valyu 888 afta vri node na sLL we gt di valyu we dn gi.
vi. moveLastNodeToBegin() na mmba fnshn we de ritn pynta to wan linked list we na di
rizulyt f muv di las node na sLL to di biginin f sLL. Fgzampul, if sLL gt 2.1,.
3.2,5.3,1.4,7.5, den we dn kl di fnshn, wan pynta to di list we gt 7.5,2.1,.
3.2,5.3,n 1.4 f kam bak. If sLL gt ziro wan node, di fnshn de kam bak
wan pynta to di list we n nid f mek ni chenj.
vii. displayList() na mmba fnshn we de sho l di node dn na sLL.
-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
Kmplit di program insay C++, mek wan MySinglyList.cpp fayl n ndit di da fayl dn.
Notis se yu ONLI ALAW f yuz isEmpty(), setHead(...), getHead() fnshn dn we dn gi na SinglyList klas.
-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
main.cpp
#inklud we yu kin yuz
#include ""Mi SingliList.h""
#inklud ""Node.h"".
yuz nemsps std;
int men().
{
cout <<""------------------------""<<ndl;
cout <<""Knstrkshn f miSLL"" << endl;
cout <<""------------------------""<<ndl;
MiSinglyList miSLL;
cout <<ndl;
cout <<""------------""<<ndl;
cout <<""adValyu (10)""<<ndl;
cout <<""---------

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Database Concepts

Authors: David Kroenke, David Auer, Scott Vandenberg, Robert Yoder

8th Edition

013460153X, 978-0134601533

More Books

Students also viewed these Databases questions