consolidate all repos to one for archive

This commit is contained in:
2025-01-28 13:46:42 +01:00
commit a6610fbc7a
5350 changed files with 2705721 additions and 0 deletions

View File

@@ -0,0 +1,14 @@
#include "Stack01b.h"
void push(int n) {
arr[++top] = n;
}
int pop() {
return arr[top--];
}
int isEmpty() {
return top == EMPTY;
}

View File

@@ -0,0 +1,15 @@
#ifndef EXAMPLE01B_STACK01B_H
#define EXAMPLE01B_STACK01B_H
#define SIZE 50
#define EMPTY (-1)
static int arr[SIZE];
static int top = EMPTY;
void push(int n);
int pop();
int isEmpty();
#endif //EXAMPLE01B_STACK01B_H

View File

@@ -0,0 +1,16 @@
#include <iostream>
#include "Stack01b.h"
int main() {
push(7);
push(1);
std::cout << "Pop from stack: ";
std::cout << pop() << " ";
std::cout << pop() << " ";
std::cout << std::endl;
if (isEmpty())
std::cout << "Stack is empty" << std::endl;
else
std::cout << "Stack isn't empty" << std::endl;
return 0;
}