mirror of
https://github.com/TheAlgorithms/C-Plus-Plus.git
synced 2026-04-13 17:50:45 +08:00
Merge branch 'master' into fix-LL
This commit is contained in:
@@ -101,7 +101,7 @@ int main()
|
||||
cout<<"\n2. Delete";
|
||||
cout<<"\n3. Search";
|
||||
cout<<"\n4. Print";
|
||||
cout<<"\n5. Exit";
|
||||
cout<<"\n0. Exit";
|
||||
cout<<"\n\nEnter you choice : ";
|
||||
cin>>choice;
|
||||
switch (choice)
|
||||
@@ -115,8 +115,8 @@ int main()
|
||||
case 3 : cout<<"\nEnter the element to be searched : ";
|
||||
cin>>x;
|
||||
search(x); break;
|
||||
case 4 : show(); break;
|
||||
case 5 : exit(0);
|
||||
case 4 : show();
|
||||
cout<<"\n"; break;
|
||||
}
|
||||
}
|
||||
while(choice!=0);
|
||||
|
||||
@@ -1,12 +1,12 @@
|
||||
#include<iostream>
|
||||
using namespace std;
|
||||
|
||||
int stack[10];
|
||||
int top=0;
|
||||
int *stack;
|
||||
int top=0, size;
|
||||
|
||||
void push(int x)
|
||||
{
|
||||
if(top==10)
|
||||
if(top==size)
|
||||
{
|
||||
cout<<"\nOverflow";
|
||||
}
|
||||
@@ -42,6 +42,9 @@ void topmost()
|
||||
}
|
||||
int main()
|
||||
{
|
||||
cout<<"\nEnter Size of stack : ";
|
||||
cin>>size;
|
||||
stack = new int[size];
|
||||
int ch, x;
|
||||
do
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user