Merge branch 'master' into fix-LL

This commit is contained in:
Ashwek Swamy
2019-02-09 16:10:58 +05:30
committed by GitHub
13 changed files with 170 additions and 100 deletions

View File

@@ -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);

View File

@@ -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
{