singly linked list, C/C++ Programming

Assignment Help:
For this program you will add and test 2 new member functions to the IntSLList class posted on the website.

The two member functions are:

insertByPosn(int el, int pos)
Assuming that the positions of elements of a list begin numbering at 1 and continue to the end of the list, you will insert a new node with info value el at position pos. pos will become the position of the new node in the modified list. For example, if pos = 1, insert the new node at the head of the list. If pos = 2, for example, insert the new node BEFORE the node currently at position 2. If the list is empty prior to insertion, insert the new node in the list and adjust head and tail pointers. If pos is too large, don''t do anything. If pos is 0 or negative, don''t do anything.

removeByPosn(int pos)
Assume position of elements are defined as above. If pos is zero or negative, do nothing. If the list is empty prior to the request to delete a node, do nothing. If pos is too large, do nothing.

To aid in verifying results, you should use the following modified version of printAll. This requires: include

void IntSLList::printAll(string locn) const {
cout << "Contents of the list " << locn << endl;
for (IntSLLNode *tmp = head; tmp != 0; tmp = tmp->next)
cout << tmp->info << " ";
if (head != 0)
cout << "Head is: " << head->info << " Tail is: " << tail->info << endl << endl;
}


Related Discussions:- singly linked list

Write a c program as text layout, Your task in this project is to write a C...

Your task in this project is to write a C program named layout.c which does text layout. This is a staged project, complete the stages in order. The maximum mark if you nish each

basic salary of employees & calculate net salary, basic salary of employee...

basic salary of employees & calculate net salary in C++ Programming

Program is to define a class as teacher, Program is to define a class as te...

Program is to define a class as teacher: Program is to define a class as teacher and collect information about them by using classes and object class teacher   {   pr

Largest clique, find largest clique present in graph

find largest clique present in graph

Padovan string, #questio#A Padovan string P(n) for a natural number n is de...

#questio#A Padovan string P(n) for a natural number n is defined as: P(0) = ‘X’ P(1) = ‘Y’ P(2) = ‘Z’ P(n) = P(n-2) + P(n-3), n>2 where + denotes string concatenation. For a string

Write a program to find files-unix, This programming assignment is for use ...

This programming assignment is for use in the LINUX/UNIX environment!! Introduction: System administration often requires custom written programs and tools. One problem a s

Abcd, #question.gsdjfhjhjfkfk.

#question.gsdjfhjhjfkfk.

Summations, How do you write the code for summations

How do you write the code for summations

OpenGL configured environment, 1. Using Visual C++ and your OpenGL co...

1. Using Visual C++ and your OpenGL configured environment, write an application that displays a “unique” graphical scene that you designed and coded for this course. What yo

Write Your Message!

Captcha
Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd