cSet01
Home ] Up ]

 

//CSet01.cpp
//Date 04/21/2003
//Author: AOU

#include <iostream.h>


const int UNDEFINED = -99;


class CNode
  {
  private:
    int m_info;
    CNode *m_next;
  public:
    CNode(void);
    CNode(char ch);
    CNode(int x);
    void display(void);
    int get(void);
    void set(int x);
  };


class CSet
  {
  private:
    CNode *m_first;
    int m_n;
  public:
    CSet(void);
    CSet(char ch);
    CSet(CNode n);
    void insert(int x);
    CNode* seqSearch(int x);
    void display(void);
    void sortBubble(void);
    void sortSelection(void);
    void sortInsertion(void);

  };


void main(void)
  {
  CNode myNode;
  myNode.display();
  cout << endl;

  CNode myNode1(55);
  myNode1.display();
  cout << endl;
  }


CNode::CNode(void)
  {
  m_info = UNDEFINED;
  m_next = NULL;
  }


void CNode::display(void)
  {
  cout << m_info;
  }


CNode::CNode(int x)
  {
  this->m_info = x;
  this->m_next = 0;
  }


/*
SAMPLE RUN:

-99
55
Press any key to continue

*/