Docsity
Docsity

Prepare for your exams
Prepare for your exams

Study with the several resources on Docsity


Earn points to download
Earn points to download

Earn points by helping other students or get them with a premium plan


Guidelines and tips
Guidelines and tips

Doubled Linked Nodes - Data Structures I - Homework 9 | COMP 380, Assignments of Data Structures and Algorithms

Material Type: Assignment; Class: DATA STRUCTURES I; Subject: Computer Science; University: Wentworth Institute of Technology; Term: Spring 2006;

Typology: Assignments

Pre 2010

Uploaded on 08/18/2009

koofers-user-lg8
koofers-user-lg8 🇺🇸

10 documents

1 / 1

Toggle sidebar

This page cannot be seen from the preview

Don't miss anything!

bg1
Wentworth Institute of Technology
Division of Professional and Continuing Studies
COMP380 Section 71 - Data Structures I - Spring, 2006
Homework 9 – Double Linked Nodes
Instructor: Bob Goldstein (617) 912-2512
bobg@vision.eri.harvard.edu
http://webpages.charter.net/tlgcreations/Courses/index.html
http://goldstein.eri.harvard.edu/courses/index.html
http://myweb.wit.edu/goldsteinr/Courses/index.html
Due Date: April 6, 2006
Hand In: Printout of program code and dialogue of how it runs.
Purpose: Practice using Double Linked Nodes to implement linked lists
1. Start with the UseDNodes program we did in class. You will also need to make a copy, in your
own project of the Ford and Topp DNodes Class and DNode class. The first step is just to get this
project implemented on your own machine and run it.
2. Add a method , rotateLeft(int n,DNode<T> header) that will shift the list
to the left by n items. Make sure you put error checks into your program so that it will do the
proper thing if there are too few nodes. Test your method.
3. Add a similar method rotateRight(int n,DNode<T> header) to your
program and test.
Extra Credit:
Start with the ListCommand program we did in class. Add the “S” command to the command line
options that will Shift the list to t he left or right.
S 2 //this will shift the list to the right by two nodes
S -2 //this will shift the list to the left by two nodes
/app/work/qkd3fq-384266-2765024-homework9-doc.doc 1 11/29/2020 11/29/2020

Partial preview of the text

Download Doubled Linked Nodes - Data Structures I - Homework 9 | COMP 380 and more Assignments Data Structures and Algorithms in PDF only on Docsity!

Wentworth Institute of Technology

Division of Professional and Continuing Studies

COMP380 Section 71 - Data Structures I - Spring, 2006

Homework 9 – Double Linked Nodes

Instructor: Bob Goldstein (617) 912- bobg@vision.eri.harvard.edu http://webpages.charter.net/tlgcreations/Courses/index.html http://goldstein.eri.harvard.edu/courses/index.html http://myweb.wit.edu/goldsteinr/Courses/index.html Due Date: April 6, 2006 Hand In: Printout of program code and dialogue of how it runs. Purpose: Practice using Double Linked Nodes to implement linked lists

  1. Start with the UseDNodes program we did in class. You will also need to make a copy, in your own project of the Ford and Topp DNodes Class and DNode class. The first step is just to get this project implemented on your own machine and run it.

2. Add a method , rotateLeft(int n,DNode header) that will shift the list

to the left by n items. Make sure you put error checks into your program so that it will do the proper thing if there are too few nodes. Test your method.

3. Add a similar method rotateRight(int n,DNode header) to your

program and test. Extra Credit: Start with the ListCommand program we did in class. Add the “S” command to the command line options that will Shift the list to t he left or right. S 2 //this will shift the list to the right by two nodes S -2 //this will shift the list to the left by two nodes /app/work/qkd3fq-384266-2765024-homework9-doc.doc 1 11/29/2020 11/29/