Hw1 - linked list was a dynamically allocated array of...

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

View Full Document Right Arrow Icon
Homework Assignment #1 CS 163: Data Structures Spring 2010 The Purpose of this Homework is to practice Linear Linked Lists and Recursion which were part of our CS162 curriculum To prepare for this homework please review Linear Linked Lists and Recursion from CS162. All answers should be supplied in C++ Linear Linked List Practice ( your answers may be iterative or recursive ) 1)      Show an  example of what a node structure would look like – if the data in a linear  linked list was an integer 2)      Write the code to add an integer to the beginning of a linear linked list 3)      Write the code to add an integer to the end of a linear linked list 4)      Write the code to remove the last item in a linear linked list 5)      Show an  example of what a node structure would look like – if the data in a linear 
Background image of page 1

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

View Full DocumentRight Arrow Icon
Background image of page 2
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: linked list was a dynamically allocated array of characters 6) Write the code to copy the entire contents of a linear linked list (of integers) creating a new (empty to begin with) linear linked list. 7) Now, change your answer to #6 assuming that the data in each node is now a dynamically allocated array of characters. 8) ITERATIVELY: Write a function that will delete from an unsorted linked list of integers the node that contains the largest item, using only a single traversal. ***do this iteratively *** Recursion 9) Write a recursive function to find out if your name is stored in a linear linked list of names. 10) Write a recursive function to display the last node of a linear linked list....
View Full Document

Page1 / 2

Hw1 - linked list was a dynamically allocated array of...

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

View Full Document Right Arrow Icon
Ask a homework question - tutors are online