#include #include using namespace std; struct node { int val; node* next; }; void insert(node*& H, int x); void remove(node*& H); void show(node* H); //void zadanie1(??); //void zadanie2(??); int main() { node* H = NULL; insert(H, 10); insert(H, 7); insert(H, 12); insert(H, 8); insert(H, 5); insert(H, 1); show(H); //zadanie1(???); //zadanie2(???); //show(H); system("PAUSE"); return 0; } //void zadanie1(??) //{ //} //void zadanie2(??) //{ //} void insert(node*& H, int x) { node* p; p = new node; p->val = x; p->next = H; H = p; } void remove(node*& H) { if (H != NULL) { node* p = H; H = p->next; delete p; } } void show(node* H) { node* p = H; cout << "H -> "; while (p != NULL) { cout << p->val << " -> "; p = p->next; } cout << "NULL" << endl; }