



Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
Prepare for your exams
Study with the several resources on Docsity
Earn points to download
Earn points by helping other students or get them with a premium plan
Community
Ask the community for help and clear up your study doubts
Discover the best universities in your country according to Docsity users
Free resources
Download our free guides on studying techniques, anxiety management strategies, and thesis advice from Docsity tutors
Sample questions and answers for an in-class exam on data structures, specifically focusing on stacks, for a university-level computer science course. The questions include processing a postfix expression, writing a function to copy a stack, analyzing program output, drawing pictures of linked lists, and implementing a method for stack equality.
Typology: Exams
1 / 6
This page cannot be seen from the preview
Don't miss anything!
#include
int main() { Node *nodes[ 4 ]; for (size_t i=0;i< 4 ;i++) { nodes[i] = NULL; for (size_t j=1;j<=i;j++) { Node *temp = new Node; temp>data = j; temp>next = nodes[i]; nodes[i] = temp; } } }
struct Dnode { Dnode * prev; int data; Dnode *next; };