Demonstrate understanding of a concrete data structure

Assignment Help Programming Languages
Reference no: EM133746276

Algorithms and Data Structures

Assignment: Dictionary Based on Linked List

LO1: Improve your proficiency in C programming and your dexterity with dynamic memory allocation.
LO2: Demonstrate understanding of a concrete data structure (linked list).
LO3: Practice multi-file programming and improve your proficiency in using UNIX utilities.

Background
A dictionary is an abstract data type that stores a collection of data records and supports lookup of key, delete a key, insert a data record. For example, in a telephone directory, the (string) key is a person or company name, and the data record is the tuple (name, phone number).

Your Task

Assignment:

In this assignment, you will create a simple dictionary based on a linked list to store information about Australian suburbs from a dataset. Users will be able to perform operations on this dictionary, such as searching for suburbs using attributes in the dataset (keys) or removing specific suburbs from the dictionary.
C Implementation:
Your program will build the dictionary by reading data from a file. It will insert each suburb record as a node in a linked list.
You will also implement the following tools:
A search tool that looks for a key in the list and outputs any records that match the key.
A removal tool that removes all records associated with a set of specified keys. This tool should output the remaining records at the end to a new CSV file.

Dataset and Assumptions
The opendatasoft website provides numerous databases, enabling organisations and individuals to seamlessly access and share data. The dataset used in this assignment is a simplified version derived from the "State Suburbs - Australia" database on that website which originates from ABS data. You can browse or visualize the original database using the link above. The whole simplified dataset, as well as smaller samples, can be found in the Dataset Download slide.

The provided text gives a detailed description of the data format and assumptions for the assignment. Here's a summary of the key points:
Fields and Data Types:
COMP20003 Code , Official Code Suburb , Year : integers
Longitude , Latitude : doubles
all other fields: strings (may contain spaces and commas)

Special Cases:

Official Code State , Official Code Local Government Area : comma-separated lists of integers (treated as strings for this assignment).
comma-containing strings: enclosed in double quotes ("") within the CSV file, the quotes are removed when stored in your program according to standard CSV rules.
CSV File Assumptions:
Note that normally a suburb lies entirely inside a single state, as well as a single local government area, but this is not a universal rule. Suburbs might be in multiple local governments areas and
multiple states. This is why the fields and
are not classified as integers. Each of these fields is actually a comma-separated list of integers.
For the purposes of this assignment, it is fully sufficient to consider this as a string.

Implementation Details

Assignment 1 will involve producing two programs, classified into two stages.

Stage 1 will implement the lookup of data by a given key ( Official Name Suburb ) and
Stage 2 will implement the deletion of data by a given key ( Official Name Suburb ), with the remaining data being output after all deletions are finished.
The implementation details are designed to not prevent the Stage 1 and Stage 2 executables from being the same - though both programs must be produced from your Makefile. In Assignment 2 you will add two additional stages using a new data structure that uses the dictionary you build in both stages to more efficiently perform particular operations.

Stage 1 - Data Retrieval
In Stage 1, you will implement the basic functionality for a dictionary allowing the lookup of data by key ( Suburb Name ).
Your should produce an executable program called dict1 . This program should take three

command line arguments:

The first argument will be the stage, for this part, the value will always be
The second argument will be the name of the input CSV data file.
The third argument will be the name of the output file.

Read the data from the CSV data file specified in the second command line argument. The data from the CSV file should be stored in a linked list of pointers to struct s for the data. The datatypes for each field should be consistent with those in the Dataset and Assumptions slide. Each record (row) should be stored in a separate node.
The program should:
Accept Official Name Suburb s from stdin , and search the list for all matching records.

You must output all matching records to the output file. If no matches for the query are found, your program should output NOTFOUND . When outputting data records, you should follow the guidelines described in the slide Dataset and Assumptions.

In addition to outputting the record(s) to the output file, the number of records found should be output to stdout .

You can assume all queries will be terminated by a newline character, allowing queries for entries with empty suburb names. While you will have to retrieve the field headers for each

column, you can assume you know the field referred to as Official Name Suburb , is the second (0-based index) column in the dataset.
For modularity reasons, to assist with Assignment 2, your approach should ideally:

Store information about the result of the search itself independently from the structure of the list, e.g. your approach should make it simple to add additional search-related information to the result of the query.
Be structured in a way that the processed data can be passed to another function to construct a new data structure.

Just like Stage 1, read the data from the CSV data file specified in the second command line argument. The data from the CSV file should be stored in a linked list of pointers to struct s for the data. The datatypes for each field should be consistent with those in the Dataset and Assumptions slide. Each record (row) should be stored in a separate node.

Your program should:
Accept Official Name Suburb s from stdin , then remove all the matching records from the dictionary.
Once the user has signified the end of input, you must output all remaining records to the output file in the CSV format.
In addition to outputting the output CSV file, the total number of records removed should be output to stdout .

Just like Stage 1, you can assume all queries will be terminated by a newline character, allowing queries for entries with empty suburb names. While you will have to retrieve the field headers for each column, you can assume you know the field referred to as Official Name Suburb , is the second (0-based index) column in the dataset.

You will not be required to implement deletion for Assignment 2, but your approach to deletion should ideally allow for the modified data to be passed to a further function if required in a similar way to the original data.

For testing, it may be convenient to create a file of keys to be searched, one per line, and redirect the input from this file. Use the UNIX operator.

Reference no: EM133746276

Questions Cloud

How the theoretical model or treatment described : Article Review, you must discuss how the theoretical model or treatment described in the article compares to the information discussed in your textbook.
Explain claire literacy goals and intervention strategies : Briefly explain Claire's literacy goals and the intervention strategies determined in the Topic 5 assignment and how the strategies support her literacy skills
How do i upload media files in my canvas studio account : How do I upload media files in my Canvas Studio account? How do I embed Canvas Studio media in a discussion reply in Canvas as a student?
History of migraines has been prescribed propranolol : An adult client with a history of migraines has been prescribed propranolol.
Demonstrate understanding of a concrete data structure : COMP20003 Algorithms and Data Structures, University of Melbourne - Improve your proficiency in C programming and your dexterity with dynamic memory allocation.
How does the work contribute to understanding : The Meaning of Messages, and how does this work contribute to understanding cross-cultural communication, multiculturalism, and interethnic relations?
Examine legal liability in prescribing medications : To examine legal liability in prescribing medications To study the causes and treatments of mental illness To examine one person in-depth
Explain how the policy contributes to positive change : Describe the Saudi Vision 2030 goal pertinent to the identified public health concern. Explain how the policy contributes to positive change.
Abortive therapy for client who experiences migraines : The nurse is planning abortive therapy for a client who experiences migraines. What goal should the nurse prioritize?

Reviews

len3746276

8/14/2024 2:14:51 AM

It is a C language (Please don't forget to code in the modular format) And you will also do the self evaluation which is in the pdf and it is needed Please give it to the someone who is good at it

Write a Review

Programming Languages Questions & Answers

  Write a haskell program to calculates a balanced partition

Write a program in Haskell which calculates a balanced partition of N items where each item has a value between 0 and K such that the difference b/w the sum of the values of first partition,

  Create an application to run in the amazon ec2 service

In this project you will create an application to run in the Amazon EC2 service and you will also create a client that can run on local machine and access your application.

  Explain the process to develop a web page locally

Explain the process to develop a Web page locally

  Write functions

These 14 questions covers java class, Array, link list , generic class.

  Programming assignment

If the user wants to read the input from a file, then the output will also go into a different file . If the user wants to read the input interactively, then the output will go to the screen .

  Write a prolog program using swi proglog

Write a Prolog program using swi proglog

  Create a custom application using eclipse

Create a custom Application Using Eclipse Android Development

  Create a application using the mvc architecture

create a application using the MVC architecture. No scripting elements are allowed in JSP pages.

  Develops bespoke solutions for the rubber industry

Develops bespoke solutions for the rubber industry

  Design a program that models the worms behavior

Design a program that models the worm's behavior.

  Writing a class

Build a class for a type called Fraction

  Design a program that assigns seats on an airplane

Write a program that allows an instructor to keep a grade book and also design and implement a program that assigns seats on an airplane.

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