zbMidterm 2 Review Problems

# zbMidterm 2 Review Problems - Wednesday,February22nd...

This preview shows pages 1–5. Sign up to view the full content.

Wednesday, February 22nd  Midterm Review 1. Stacks and Queues 2. Inheritance, Polymorphism 3. Recursion Be able to read and write code using:

This preview has intentionally blurred sections. Sign up to view the full version.

View Full Document
Review Time Once you have completed this review, you will be able to comprehend and control the Matrix!
Review Problem #1 struct NODE { int val; NODE *next, *prev; }; Write a recursive function called freeList that accepts a pointer to a doubly linked list node. The  function must print all of the items in order and also delete all nodes except for the first in the linked  list. void main() {    NODE *head;  // ptr points to the first node (e.g. head) of the linked list    head = createSomeLinkedList();    freeList(head); }

This preview has intentionally blurred sections. Sign up to view the full version.

View Full Document
Problem #2: A Fishy Mess Create a set of C++ classes using inheritance: 1. All Sea Animals can make noise using a makeNoise function that takes  no arguments and returns nothing 2. You must specify a Sea Animal’s weight when its born
This is the end of the preview. Sign up to access the rest of the document.

## This note was uploaded on 04/02/2012 for the course COMPUTER S 32 taught by Professor Smallberg during the Winter '12 term at UCLA.

### Page1 / 7

zbMidterm 2 Review Problems - Wednesday,February22nd...

This preview shows document pages 1 - 5. Sign up to view the full document.

View Full Document
Ask a homework question - tutors are online