HW2_recursion.pdf

# HW2_recursion.pdf - COSC 2320 Data Structures Homework 2...

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

COSC 2320: Data Structures Homework 2: Union and Intersection of Doubly Linked Lists using Recursion Deadline: Oct. 11, 2014 1. INTRODUCTION You will write a C++ program to find the intersection and/or union of two doubly linked lists using recursion. You are not allowed to use the STL Library to implement linked list . A set is a collection of distinct entities regarded as a unit, being either individually specified or (more usually) satisfying specified conditions. In set theory the union of two sets A and B, is the set of all distinct elements in A and B. The intersection of two sets A and B is the set that contains all elements of A that also belong to B (or equivalently, all elements of B that also belong to A), but no other elements. In mathematics, the notion of bag (or multiset) is a generalization of the notion of set in which members are allowed to appear more than once. For this homework we will work with bags. 2. INPUT & OUTPUT The input of the program is a text file with multiple commands to be executed by the program, one command per line. The commands are defined as follows: Read [ file name ] [ list name ] Read the specified file from disk and insert each word in the file into a doubly linked list named as [ list name ] . The file specified in this command, if exists, will be a text file, with an unbounded number of different words (case-sensitive) in ALPHABETICAL ORDER , separated by spaces, commas or periods. The input file can have several lines terminated by carriage returns. You can assume words will be at most

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

View Full Document
This is the end of the preview. Sign up to access the rest of the document.

{[ snackBarMessage ]}

### What students are saying

• As a current student on this bumpy collegiate pathway, I stumbled upon Course Hero, where I can find study resources for nearly all my courses, get online help from tutors 24/7, and even share my old projects, papers, and lecture notes with other students.

Kiran Temple University Fox School of Business ‘17, Course Hero Intern

• I cannot even describe how much Course Hero helped me this summer. It’s truly become something I can always rely on and help me. In the end, I was not only able to survive summer classes, but I was able to thrive thanks to Course Hero.

Dana University of Pennsylvania ‘17, Course Hero Intern

• The ability to access any university’s resources through Course Hero proved invaluable in my case. I was behind on Tulane coursework and actually used UCLA’s materials to help me move forward and get everything together on time.

Jill Tulane University ‘16, Course Hero Intern