Monash University > CSSE > CSE1303 > Part A > Tutorials > Tutorial A3

CSE1303 Computer Science
Summer Semester, 2003
Part A
Tutorial A3 : Lists, ADTs, and Dynamic Memory

This tute covers material from lectures A05 to A06.

There may not be time in the tutorial to cover all of these questions. Attempt at least the ones marked with an asterisk before the tutorial; these are the ones that will be focussed on during the class. If you have specific questions about unmarked questions, you can ask the tutor about them during the tutorial. If you want further revision questions, suggestions of questions from the textbooks are provided at the end of the tutorial sheet.


Note: The purpose of tutorials is not simply to give you the answers to these questions! (Solutions will be released in about a week online, so if all you want is the answers, there are easier ways.)


* Exercise 1

* Exercise 2

* Exercise 3

  1. Write a C function char* strdup(const char* s) which makes a copy of the string s and returns a pointer to where the copy is stored, and NULL if there is not enough memory.

  2. Where should you free the memory you have allocated for the new string in the function char* strdup(const char* s) and why?

* Exercise 4

Exercise 5. (Will not be on the exam)

Exercise 6

ADDITIONAL EXERCISES

[ Top | Home ]

Last modified: Tuesday 02 December 2003 22:29:33