

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
A review session plan for the upcoming exam on data structures, focusing on queues, stacks, and link lists. The session includes addressing student questions, providing review problems, and going over the basics of each data structure. Exercises are provided for students to work on in groups, with sample answers and comments included.
Typology: Exams
1 / 3
This page cannot be seen from the preview
Don't miss anything!


Erik Madrid Marcus Valenzuela Xomary Rodarte Miguel Cuellar
Overview For this week's session plan, we have decided that we should conduct a review session for the next upcoming exam this Thursday and Friday. In order to achieve a good learning session, we agreed on addressing certain questions students may have from previous session, and then providing with our own set of review problems to the class (all problems may be answered in a cooperative learning manner as always). The main topics to review are queues, stacks, and link lists. Since recursion also plays an important part in some operation for this data structures, we will also apply them as a previous review for the class. At the end of the session, students should be ready for the upcoming exam.
Lesson Plan:
Activity Time(mins) Questions. Anyone? 5 Break group into groups of 2 or 3 2 Go over basic structure of Link List 5 Review stack characteristics 5 Definition and implementation of queues and circular queue 8 Do exercises 15 Go over exercises as a group 10
Total Time = 50 minutes.
Note. -This plan can vary depending on the participation of the group and the number of students in the session.
Before starting with the exercises, we believe it is convenient to review all data structure first and then let them work on the exercises as a group and answering the questions as a class. The exercises will be the following:
Link List
//Gives the sum of a list recursively public static int sum (LN l) { if (l == null) return 0;
else return l.value + sum(l.next); }
//Searches for a value in the list recursively public static LN search (LN l, int value) { if (l == null) return null; else if (l.value == value) return l; else return search(l.next, value); }
Note: For the 2 above, please just insert the comments to your copies for the students. I just provided a sample answer for simplicity.
//Trace the following operations on a link list. Include the state of the list at every operation and //the value of the head.
LinkedList list = new LinkedList(); LinkedList list2 = new LinkedList(); insert(list, Node a); insert(list, Node b); insert(list, Node c); remove(list, Node b); find(list2Node c); concatinate(list, list2);
Stacks //Give pseudo-code for any useful implementation of a stack not seen in class.
Queues // What is the difference between a queue and a circular queue?
//Show the state of the queue at every operation. For each, show the top and bottom pointing value of the queue.
Queue q = new Queue(4); enqueue(1); enqueue(2); enqueue(3) ; dequeue();