Sets and bags, Computer Engineering

Task: Sets and bags

In mathematics, the notion of multiset (or bag) is a generalisation of the notion of set.

A bag is a special kind of container in which the items may be repetitive, and without any order. A set is a container in which items may NOT be repetitive (each element in a set is unique).

Our purpose in this assignment is to implement the set and bag concept by using an array-based list structure.

The program

This assignment will be implemented by the use of 2 interfaces named:
1. SetList
2. BagList

The SetList interface will contain the following method headers: 

Sets

The implementation of the SetListType has to take into account the fact that repeat values are not stored. The only requirement as far as this assignment is concerned, is that you use an array-based list structure to implement both sets and bags.

Bags

The implementation of the BagListType has to take into account the fact that repeat values are stored. For the purposes of this assignment , we will employ a dual array technique so as to eliminate having to physically store a value (object) we have already put into our bag structure. One array will store the object, the second array will store the number of times this object is present in our bag structure (i.e., the second array is of type  int)For example, for an input of Integers of the following values:

1 2 3 4 5 3 2

These values would normally be stored in a single array as shown below.

1021_Sets and bags.png

Posted Date: 2/26/2013 2:03:36 AM | Location : United States







Related Discussions:- Sets and bags, Assignment Help, Ask Question on Sets and bags, Get Answer, Expert's Help, Sets and bags Discussions

Write discussion on Sets and bags
Your posts are moderated
Related Questions
The original Pascal standard was an unofficial standard documented by the author, Nicklaus Wirth, in "The Report". The first official standard was ISO 7185 issued in 1983. This was

Explain the working of Assembler? An assembler is the computer program for translating assembly language fundamentally a mnemonic representation of machine language into object

Explain the High Level Language? The programming language such as FORTRAN, C, or Pascal that enables a programmer to write programs those are more or less independent of a parti

Determine the BIOS function with one illustration BIOS stands for Basic Input Output System. It is a set of programs to provide most basic low-level services like services keyb

Brjrbtjr

In an ASP.NET web application that does not build use of routing, an incoming browser request should map to a physical file. If the file does not exist, we get page not found error

Computer Architecture Basics: Some of computer architecture at companies such like AMD and Intel uses more fine distinctions: Macro architecture- this is an architectura

Write short note on Associated vs. Common channel signaling. Associated vs Common channel signalling: The out band signalling suffers from the very restricted bandwidth.

Is the ROM a volatile memory? Explain Ans. No, ROM is a Non-Volatile memory. Programming of ROM includes making of the needed  interconnections at  the time of fabrication and

To see a high-level representation of the structure of a local site, you use Dreamweaver's Site Map view. You can also use site map to add new files to the site, to add, remove and