zbMidterm 2 Review Problems

zbMidterm 2 Review Problems - Wednesday,February22nd...

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

View Full Document Right Arrow Icon
Wednesday, February 22nd  Midterm Review 1. Stacks and Queues 2. Inheritance, Polymorphism 3. Recursion Be able to read and write code using:
Background image of page 1

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

View Full DocumentRight Arrow Icon
Review Time Once you have completed this review, you will be able to comprehend and control the Matrix!
Background image of page 2
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); }
Background image of page 3

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

View Full DocumentRight Arrow Icon
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
Background image of page 4
Image of page 5
This is the end of the preview. Sign up to access the rest of the document.

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 Right Arrow Icon
Ask a homework question - tutors are online