How many total orderings can be defined on a set with n elem

How many total orderings can be defined on a set with n elements? Explain your answer.

Data Structures and Algorithm Analysis in C++ by Clifford Shaffer
How many total orderings can be defined on a set with n elements? Explain your answer.

Data Structures and Algorithm Analysis in C++ by Clifford Shaffer

Data Structures and Algorithm Analysis in C++ by Clifford Shaffer

Solution

# include <iostream.h>
# include <conio.h>
# define MAX 10
class stack
{
int stck[MAX],top;
public:
stack()
{
top=-1;
}
void push()
{
int x;
if(top==MAX-1)
{
cout<<\"STACK IS FULL \";
}
else
{
cout<<\"Enter a number to push \";
cin>>x;
stck[++top]=x;
}
}
void pop()
{
if(top==-1)
{
cout<<\"STACK IS EMPTY\";
}
else
cout<<\"POPPED VALUE IS \"<<stck[top--];
}
void print()
{
if(top==-1)
{
cout<<\"STACK IS EMPTY\";
}
else
{
for(int i=0;i<=top;i++)
cout<<stck[i]<<\"\\t\";
}
}
};
void main()
{
clrscr();
stack s;
int ch=1;
while(ch!=4)
{
cout<<\"\ 1.Push \";
cout<<\"\ 2.Pop \";
cout<<\"\ 3.Print \";
cout<<\"\ 4.Exit\";
cout<<\"\ Enter your choice \";
cin>>ch;
switch(ch)
{
case 1:
       s.push();
       break;
case 2:
       s.pop();
       break;
case 3:
       s.print();
       break;
case 4:
       cout<<\"Stack is closed\";
}
getch();
}
}

How many total orderings can be defined on a set with n elements? Explain your answer. Data Structures and Algorithm Analysis in C++ by Clifford Shaffer How man
How many total orderings can be defined on a set with n elements? Explain your answer. Data Structures and Algorithm Analysis in C++ by Clifford Shaffer How man

Get Help Now

Submit a Take Down Notice

Tutor
Tutor: Dr Jack
Most rated tutor on our site