sh -c make-s ./llcpInt.cpp:22:29: error: no matching constructor for initialization of 'Node' Node* tmp = new Node(curr->data); NNN ./llcpInt.h:6:8: note: candidate constructor (the implicit copy constructor) not viable : no known conversion from 'int' to 'const Node' for 1st argument struct Node ./llcpInt.h:6:8: note: candidate constructor (the implicit move constructor) not viable : no known conversion from 'int' to 'Node' for 1st argument ./llcpInt.h:6:8: note: candidate constructor (the implicit default constructor) not via ble: requires arguments, but 1 was provided

EBK JAVA PROGRAMMING
9th Edition
ISBN:9781337671385
Author:FARRELL
Publisher:FARRELL
Chapter9: Advanced Array Concepts
Section: Chapter Questions
Problem 2PE
icon
Related questions
Question
100%

#ifndef LLCP_INT_H
#define LLCP_INT_H

#include <iostream>

struct Node
{
   int data;
   Node *link;
};
void DelOddCopEven(Node*& headPtr);
int    FindListLength(Node* headPtr);
bool   IsSortedUp(Node* headPtr);
void   InsertAsHead(Node*& headPtr, int value);
void   InsertAsTail(Node*& headPtr, int value);
void   InsertSortedUp(Node*& headPtr, int value);
bool   DelFirstTargetNode(Node*& headPtr, int target);
bool   DelNodeBefore1stMatch(Node*& headPtr, int target);
void   ShowAll(std::ostream& outs, Node* headPtr);
void   FindMinMax(Node* headPtr, int& minValue, int& maxValue);
double FindAverage(Node* headPtr);
void   ListClear(Node*& headPtr, int noMsg = 0);

// prototype of DelOddCopEven of Assignment 5 Part 1


#endif

>sh -c make-s
./llcpInt.cpp:22:29:
error: no matching constructor for initialization of 'Node'
Node* tmp = new Node(curr->data);
./llcpInt.h:6:8: note: candidate constructor (the implicit copy constructor) not viable
: no known conversion from 'int' to 'const Node' for 1st argument
struct Node
./llcpInt.h:6:8: note: candidate constructor (the implicit move constructor) not viable
: no known conversion from 'int' to 'Node' for 1st argument
./llcpInt.h:6:8: note: candidate constructor (the implicit default constructor) not via
ble: requires arguments, but 1 was provided
1 error generated
Transcribed Image Text:>sh -c make-s ./llcpInt.cpp:22:29: error: no matching constructor for initialization of 'Node' Node* tmp = new Node(curr->data); ./llcpInt.h:6:8: note: candidate constructor (the implicit copy constructor) not viable : no known conversion from 'int' to 'const Node' for 1st argument struct Node ./llcpInt.h:6:8: note: candidate constructor (the implicit move constructor) not viable : no known conversion from 'int' to 'Node' for 1st argument ./llcpInt.h:6:8: note: candidate constructor (the implicit default constructor) not via ble: requires arguments, but 1 was provided 1 error generated
1 #include <iostream>
2 #include <cstdlib>
3 #include "llcpInt.h"
using namespace std;
45
5
6
7
0056
8
9
10
12345
11 -
12
13
14
15
16
17
18
19
20
void Delodd CopEven (Node* & headPtr) {
Node* curr = headPtr;
Node* prev = nullptr;
21 ✓
22
23
24
25
26
27
28
29 }
while (curr != nullptr) {
}
if (curr->data % 2 == 1) {
if (prev
nullptr) {
headPtr = curr->link;
delete curr;
curr = headPtr;
} else {
==
prev->link = curr->link;
delete curr;
curr = prev->link;
}
} else {
Node* tmp = new Node(curr->data);
tmp->link = curr->link;
curr->link = tmp;
prev = curr;
curr = curr->link;
Transcribed Image Text:1 #include <iostream> 2 #include <cstdlib> 3 #include "llcpInt.h" using namespace std; 45 5 6 7 0056 8 9 10 12345 11 - 12 13 14 15 16 17 18 19 20 void Delodd CopEven (Node* & headPtr) { Node* curr = headPtr; Node* prev = nullptr; 21 ✓ 22 23 24 25 26 27 28 29 } while (curr != nullptr) { } if (curr->data % 2 == 1) { if (prev nullptr) { headPtr = curr->link; delete curr; curr = headPtr; } else { == prev->link = curr->link; delete curr; curr = prev->link; } } else { Node* tmp = new Node(curr->data); tmp->link = curr->link; curr->link = tmp; prev = curr; curr = curr->link;
Expert Solution
trending now

Trending now

This is a popular solution!

steps

Step by step

Solved in 2 steps

Blurred answer
Knowledge Booster
Operations of Linked List
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
  • SEE MORE QUESTIONS
Recommended textbooks for you
EBK JAVA PROGRAMMING
EBK JAVA PROGRAMMING
Computer Science
ISBN:
9781337671385
Author:
FARRELL
Publisher:
CENGAGE LEARNING - CONSIGNMENT