Posts

Showing posts from December, 2020

Binary Number

  #include   <iostream> #include   <list> #include   <math.h> using   namespace   std ; class   BinaryNumber { public:      list < short >  getBinary ( int );      void   printBinary ( list < short >);      list < short >  onesCompliment ( list < short >);      list < short >  twosCompliment ( list < short >);      list < short >  addBinary ( list < short >,  list < short >); }; template  < typename   T > T   checkInput ( T   input ,  string   content ) {      while  (! cin . good ())     {          cout   <<   " \n Wrong Input, Please Enter It Correctly!! \n " ;      ...

Generalised Linked List

  #include   <iostream> using   namespace   std ; class   Node { public:      bool  Tag;     Node *Next;      union     {          char  Data;         Node *SubList;     }; }; class   GeneralisedLinkedList  :  public   Node { public:     Node *Front, *Tail;      GeneralisedLinkedList ();  // Default Constructer      bool   empty ();      void   push_back ();      void   push_front ();      void   pop_back ();      void   pop_front ();      void   traverse ( Node   * ); }; template  < typename   T > T   c...