Lines 7-14, 18-64: You're defining your member functions twice. Delete lines 7-14.
Lines 27-56: You're trying to pass a class instance to each function. Each function of a class refers to a class instance. It's not necessary to pass a class instance as an argument.
Line 19,70:
new
returns a pointer. a is not a pointer. This is not Java. Line 19 is not required since the list was declared at line 6. Line 70 should be simply:
Lines 21-25: Init() is not required. a is not a pointer. You can't compare it to NULL. Init() is never called.
Line 28: std::list (a) has no isEmpty() function. Use:
1 2 3
|
bool isEmpty() const
{ return a.begin() == a.end();
}
|
Line 32: std::list (a) has no addLast() function. Use:
1 2 3
|
void push(int x)
{ a.push_back(x);
}
|
Line 47,49: queue has no member called list.
Line 47,49,59: list has no member get().
Line 65: Your class declaration is missing a closing };
Line 100: case is missing a
break
statement.
Line 102: Why bother with an if statement. You already know it's not 1-5 or you wouldn't be here. BTW, your test is wrong. What if x is 0 or 6?
Lots more errors. Compile, fix the first error. Compile again. Fix the next error until you have corrected all the errors.