Monthly Archives: December 2010

Queue


#include <cstdlib> #include <iostream> #define maks 5 using namespace std; class queue { friend ostream& operator<<(ostream&,const queue&); public: queue(); int penuh(int); int kosong(int); void cetak(); void enqueue(char); char dequeue(); private: char A[maks]; int banyak; }; ostream& operator<<(ostream& out ,const queue& … Continue reading

Posted in Praktikum | Leave a comment

praktikum 7


#include <cstdlib> #include <iostream> #define maks 5 using namespace std; class stack{ friend ostream& operator<<(ostream&, const stack&); public: stack(); int penuh(int); int kosang(int); void cetak(); void push(char); char pop(); private: char A[maks]; int banyak; };

Posted in Praktikum | Leave a comment

Praktikum 6


#include <cstdlib> #include <iostream>  using namespace std; template <class T> class node { friend class List<T>; friend ostream& operator<<(ostream&, const List&); public: Node(T&t, Node* p) : info(t),berikut(p) {} protected: T info; Node *beerikut; }; template <class T> class List { … Continue reading

Posted in Praktikum | Leave a comment