A
asit
what's wrong in the following code ??
#include <iostream>
#include <string>
using namespace std;
struct node
{
int data;
node *prev;
};
node* push(node * st, int data)
{
if(st == NULL)
{
st = new node;
st->prev = NULL;
st->data = data;
}
else
{
node* t = new node;
t->prev = st;
t->data = data;
st = t;
}
return st;
}
#include <iostream>
#include <string>
using namespace std;
struct node
{
int data;
node *prev;
};
node* push(node * st, int data)
{
if(st == NULL)
{
st = new node;
st->prev = NULL;
st->data = data;
}
else
{
node* t = new node;
t->prev = st;
t->data = data;
st = t;
}
return st;
}