Trivial C, C++ Programs.

Tag Archives: Data Structures

Queues Using Linked Lists in C++

And NO, there is no meaning to adding a special operation called ‘Create’ the queue. When you push in the first element, the queue is created. Of course I didn’t bother to check for exceptions. This is a straight off the text book program, suck on it bitches.   #include<iostream.h> #include<conio.h>   struct node { [...]

Queues Using Arrays (Static) in C++

It does what it says. A first-in first-out structure, implement in the simplest possible way. Again, no bound checks. Sanitize your inputs please. #include <iostream.h>   int *Queue, front, rear, maxSize;   void createQueue(); void push(); void pop(); void dispQueue();   int main() { int choice; while(choice != 5) { cout<<"\n\n Enter your choice :" [...]

Stacks Using Arrays (Static) in C++

This is a general implementation of the stack data structure in C++. I’ve made it a ‘menu-driven’ program, for all you menu-loving whores. Nobody cares if it is rendered unreadable. Also, I’ve skipped bound checks in this program, so remember to sanitize your inputs or you may get sucked into a vortex. Also, since I’m [...]