Data Structure 1


Submit solution

Points: 1
Time limit: 1.0s
Memory limit: 64M

Author:
Problem type
Allowed languages
C++, Python3

This practice problem will require you to implement a simple Stack class, supporting some common functions.

The expected header is as follows (p027.h):

#ifndef _P027
#define _P027
#include "mylist.h"
class Stack {
    private:
        MyList list;
    public:
        bool empty();
        int top();
        void push(int val);
        int pop();
};
#endif

Your task is to implement the actual functions for this class. You can use your own MyList implementation, or you can download the reference version here (https://jetic.org/download/mylist_linux.zip; https://jetic.org/download/mylist_macOS.zip):

mylist.h
mylist.o

Class Specification

Refer to the in-class slide LS18 for more information.

Input Specification

No input specification. OJ will automatically judge your implementation of p027.cpp.

Output Specification

No output specification. OJ will automatically judge your implementation of p027.cpp.


Comments

There are no comments at the moment.