Answered step by step
Verified Expert Solution
Question
1 Approved Answer
//how do i fix this? im gettint these errors. bool sameSet(const int *aBeg, const int *aEnd, const int *bBeg, const int *bEnd) { // Add
//how do i fix this? im gettint these errors.
bool sameSet(const int *aBeg, const int *aEnd, const int *bBeg, const int *bEnd) { // Add your code yere for (auto p = aBeg; p!= aEnd; p++) { bool a = false; for (auto p2 = bBeg; p2 != bEnd; p2++) { if(*p2 == *p) { a = true; break; } else { return false; } } }
for (auto q = bBeg; q != bEnd; q++) { bool b = false; for (auto q2 = aBeg; q2 != aEnd; q2++) { if(*q2 == *q) { b = true; break; }
} } return true; }
Checking function: sameSet +For input of ARRAY (111}), ARRAY (111, 11, 11)) X For input of ARRAY (1, 4, 9, 16, 9, 7, 4, 9, 11}), ARRAY (111, 11, 7, 9, 16, 4, 1)) should be true, but is false. +For input of ARRAY (1, 4, 1}), ARRAY (11, 11, 7, 9, 16, 4, 1}) +For input of ARRAY (1, 1, 11}), ARRAY (111, 11, 7}) +For input of ARRAY (1, 4, 9, 16), ARRAY (19, 4, 1,}) +For input of ARRAY (111, 11}), ARRAY (11)) +For input of ARRAY (1, 4, 9, 16), ARRAY (19, 4, 1,}) X For input of ARRAY (111, 11, 550, 650}), ARRAY (f11, 550, 550, 650, 550) should be true, but is false. X For input of ARRAY (111, 11, 11, 11, 2), ARRAY (12,2,2,11}) should be true, but is false. +For input of ARRAY (1, 4, 91), ARRAY (9, 4, 1,16)) Tests passing 7/10 (70%)
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started