Implement the dictionary using a sorted array

Assignment Help Data Structure & Algorithms
Reference no: EM131406412

Building a Dictionary with Array and Linked List

Write a program to implement a Dictionary of integers which consists of following methods:
- SortedArray(int a) : is a constructor which creates a dictionary of size a.
- void insert(int x) : Inserts element x at its proper position.
o Raise exception Dictionary_Full when dictionary is already full (in case of SortedArray)
o If x already exists, then raise exception Duplicate_Element_Found

- boolean delete(int x) : Deletes element x and returns true if x existed otherwise false.
o If x does not exists, the operation raises the exception Element_not_Found, which handles the exception by returning the predecessor and successor of x if x would have existed in the dictionary.
o If the dictionary is empty, it raises the Dictionary_Empty exception which handles it by returning a message "Dictionary Empty"

- boolean find(int x) : Returns true if x exists otherwise false and raises the exception Element_not_Found.
- void display() : Displays the dictionary's elements in order.

The input for the program must be from the file input.txt. For example, the input.txt might contain the following sequence of operations

I(5) // I for insert I(7)
I(5)
R(7) // R is used for delete F(12) // F for find
D // D is used for display

The output should be written in a file output.txt. For example, for the above sequence of inputs, the Dictionary will generate the following output:

Inserted Element 5
Inserted Element 7 Inserted Duplicate Element Element 7 Deleted
5
5

The assignment is divided into following parts:

PART A: Implement the dictionary using a sorted array. Here you will be required to implement find operation using binary search. The class name should be SortedArrayTable

PART B: Implement the dictionary using a sorted linked list. Here you will be required to implement find operation using only linear search. You could re-use the linked list class you implemented for COSC 2006. The class name should be SortedListTable.

Verified Expert

The requirement was to implement sorted list of integers using arrays and linked list. It should have methods insert,delete,find and display. While inserting it should check if array is already full and raise an exception. It should raise exception for duplicate element also. During delete and find , it should raise an exception for no element found or array empty. Input and output should be through files.

Reference no: EM131406412

Questions Cloud

What is net neutrality : 1. What is Net neutrality? 2. Why is net neutrality such a hotly debated issue?
Explain the role of the brain in cognitive functions : Write a two-page paper in which you explain the role of the brain in cognitive functions. As a part of your explanation, describe what Phineas Gage's accident revealed about how brain areas support cognitive function.
What is the coroutine linkage in operating system : What's the coroutine linkage in Operating System? Can someone explain this concept in detail?
How are food supply impacted by increasing population size : How are food supply and nutrition impacted by the increasing population size? When considering nutrition, do you think some countries will be more susceptible than others? Explain and support your answer.
Implement the dictionary using a sorted array : COSC 2007 -Data Structures - Implement the dictionary using a sorted array. Here you will be required to implement find operation using binary search and Implement the dictionary using a sorted linked list.
Offshore outsourcing project management : You are the project manager for a software development project. An offshore outsourcing firm will develop the software. What would you do during project initiation for an offshore-outsourced project that you might do differently for a project deve..
Crud-defining information ownership : One easy way to determine information ownership is to think of CRUD-create, read, update, and delete. If you cannot only read but also create, update, and/or delete information, then in some way you own that information because you are responsible..
Explain the geographical impact with respect to health : Explain the geographical impact with respect to health. Also consider the number of lives lost, environmental damage, economic fallout, and long-term repercussions or impact.
What type of car will meet your needs : What type of car will meet your needs? Consider some of the following questions: What will you use your car for? Will you need it to haul anything? Will it need to seat more than two people?

Reviews

inf1406412

3/30/2017 4:58:49 AM

I need to give your group the greater part of the thanks on the planet for this! I will utilize your reasonable administrations again soon. Your organization is unprecedented, and I am truly thankful with all of you bailing me out with my task! Much thanks to you, SO VERY much!!!

inf1406412

3/30/2017 4:58:29 AM

ok I will pay this amount , but make sure if there is any wrong in the solution I will ask for that . tell the expert : read the assignment question carefully and do each point make a documentation to understand the code easily I want a 100% correct answer thank you first : the program should contain just two classes which is SortedArrayTable and SortedListTable, put the all exceptions in the main class second: the program should read from a txt file as it mentioned in the assignment question file Can I know how to get the program reads from the txt file ? I tested the program and there is some little mistakes when the program insert the second 5 , it should display a duplicate element ,as it shown in the assignment question I attached a screenshot please fix asap the deadline is after 24 hours

len1406412

2/27/2017 2:52:48 AM

I would like to get this assignment by java code and also I want 100% correct solution If cannot do it just tell me from now if I receive a wrong solution I want to get my money back I attach a file that have all details of the question , please don''t forget anything , thank you

Write a Review

Data Structure & Algorithms Questions & Answers

  Implement an open hash table

In this programming assignment you will implement an open hash table and compare the performance of four hash functions using various prime table sizes.

  Use a search tree to find the solution

Explain how will use a search tree to find the solution.

  How to access virtualised applications through unicore

How to access virtualised applications through UNICORE

  Recursive tree algorithms

Write a recursive function to determine if a binary tree is a binary search tree.

  Determine the mean salary as well as the number of salaries

Determine the mean salary as well as the number of salaries.

  Currency conversion development

Currency Conversion Development

  Cloud computing assignment

WSDL service that receives a request for a stock market quote and returns the quote

  Design a gui and implement tic tac toe game in java

Design a GUI and implement Tic Tac Toe game in java

  Recursive implementation of euclids algorithm

Write a recursive implementation of Euclid's algorithm for finding the greatest common divisor (GCD) of two integers

  Data structures for a single algorithm

Data structures for a single algorithm

  Write the selection sort algorithm

Write the selection sort algorithm

  Design of sample and hold amplifiers for 100 msps by using n

The report is divided into four main parts. The introduction about sample, hold amplifier and design, bootstrap switch design followed by simulation results.

Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd