Design and evaluate a hash table with collision handling

Assignment Help Other Subject
Reference no: EM133933054 , Length: Word Count:2000

Data Structures and Algorithms

Computing and Mathematical Sciences

Title: Critical Care Optimisation: Data Structures and Algorithms for Hospital Efficiency

Introduction
Modern hospitals coordinate patients, staff, equipment, and space in real time. Algorithmic solutions can improve emergency response, reduce delays, and increase reliability.

In this assignment, you will design and implement a modular hospital resource management system using core data structures and algorithms. The system should demonstrate:
Efficient storage and retrieval of patient information.
Fast and reliable pathfinding between hospital departments.
Priority-based scheduling of emergency cases.
Sorting and reporting of patient records at the end of the day.
The assignment consists of four modules (Graph, Hash Table, Heap, Sorting). Each module builds upon the others to simulate hospital operations end-to-end, where:
Graph (Module 1): Provides travel time data between hospital units.
Hash Table (Module 2): Stores patient details and urgency levels for fast retrieval. Heap (Module 3): Combines urgency (from Module 2) and time factors (from Module 1 or input data) to decide who gets treated next. Get top-notch online assignment help.
Sorting (Module 4): Takes all scheduled treatment records and organises them into sorted lists for efficiency analysis and reporting.

Learning Objectives
By completing this assignment, students will be able to:
Implement and analyse adjacency-list graphs, BFS, DFS, and a shortest path algorithm.
Design and evaluate a hash table with collision handling, suitable for 20+ records.
Implement a heap to schedule tasks by a computed priority metric and trace heap operations.
Implement merge sort and quick sort; benchmark and analyse performance under varying inputs.
Integrate multiple data structures into a coherent, testable system.

Module 1: Graph-Based Hospital Navigation
Problem Description
The hospital comprises departments such as Emergency, ICU, Pharmacy, Radiology, Laboratories, Operating Theatres, Wards, and Outpatient Units. Efficient navigation is essential for patient transfers and equipment movement.

Model the floor plan as a weighted, undirected graph:
Nodes represent departments.
Edges represent corridors/pathways between departments.
Weights are walking times (minutes).
Tasks
Graph Construction
Implement a Graph class using an adjacency list.
Support dynamic insertion of departments (nodes) and corridors (weighted edges).
Ensure undirected symmetry (u↔v with same weight).

Algorithms to Implement (no built-in graph libraries):
Breadth-First Search (BFS): Input = source department; Output = reachable departments grouped by level (hops).
Depth-First Search (DFS): Input = source; Output = whether cycles exist and, if found, nodes involved.
Shortest Path Algorithm: Implement A* Algorithm from a source; report path and total cost. Cite the algorithm source and implement from first principles without built-in shortest-path functions.

Test Case Setup
At least 8 departments (nodes).
10-12 weighted corridors (edges).
Include at least one cycle and one isolated department.

Expected Output
Textual/visual graph structure.
BFS results with levels (Level 0, Level 1, ...).
DFS cycle detection (and cycle members if present).
Shortest path and total walking time from the source department to a destination department.

Module 2: Hash-Based Patient Lookup
Problem Description
Clinicians require rapid access to patient records in emergencies. Implement a hash table to store and retrieve patient data efficiently, supporting at least 20 active records without significant performance degradation. Get top-notch online assignment help.
Tasks
Hash Table Design and Implementation (no built-in dict/Map for core logic):
Use either chaining (linked lists) or open addressing (linear probing). Justify the choice in the report.
Implement a simple modulo-based hash function; explain parameter choices (table size, prime selection).
Define a Patient record with fields: PatientID, Name, Age, Department, UrgencyLevel (1-5), TreatmentStatus.

Core Operations:
insert(record): O(1) expected; handle duplicates (update or reject with message).
search(patientID): O(1) expected; return the full patient record or a not-found message.
delete(patientID): O(1) expected; confirm deletion and handle missing keys gracefully.

Collision Handling and Load Management:
Demonstrate at least one collision scenario and show how it is resolved (probe sequence or chain state).
Discuss and (optionally) implement resizing/rehashing when load factor exceeds a threshold (e.g., 0.7).
Explain worst-case behaviors.

Validation and Error Handling:
Validate inputs (e.g., urgency 1-5 only; non-empty names; IDs unique/integer).
Ensure robustness against out-of-range indices and null references.

Testing Requirements:
Insert at least 20 patient records (include diverse urgency levels and departments).

Demonstrate successful searches (hits) and misses; demonstrate deletions and their effect on subsequent searches.
Provide timing snapshots or operation counts to support O(1) expected behaviour claims.

Expected Output:
Log of inserts, searches, and deletes (concise, readable format).
Explicit collision example(s) with intermediate states (e.g., probe indices or chain contents).
Summary of complexity, load factor behaviour, and any resizing.
Deliverables for Module 2
Source code for hash table (with comments and clear function headers).
Test driver demonstrating inserts, searches, deletes, and collision handling.
Short written justification of hash strategy, table size, and hash function.

Module 3: Heap-Based Emergency Scheduling
Problem Description
Emergency cases must be prioritised by urgency level and expected treatment time. Implement a scheduler using a heap that always returns the next highest- priority case.
Priority Metric
Priority = (6 - U) + 1000 / T
U = UrgencyLevel (1 = highest priority, 5 = lowest).
T = Expected treatment time in minutes.
Higher priority values should be treated first (Max Heap recommended).
Tasks
Heap Implementation (array-based binary heap; no use of built-in priority queues):
Choose Max Heap (recommended) and justify; alternatively, use Min Heap with inverted keys.
Implement: insert(request), peek(), extract_priority().
Maintain heap invariants after each operation (percolate up/down).

Integration with Module 2 (Data Flow):
Each request references a PatientID; retrieve UrgencyLevel and TreatmentStatus from the hash table.
Use T (expected time) provided by scenario or by shortest-path estimates

from Module 1 where applicable.
Compute the numeric priority for every request inserted.

Updates, and Edge Cases:

Support updates (e.g., urgency level change) by re-inserting or providing a decrease/increase-key strategy (documented).
Handle invalid PatientID, zero/negative treatment time, or inactive status gracefully.

Tracing and Observability:
Print the heap array after each insert and each extract_priority.
Log the computed priority and the inputs used (U and T) for each request.
Demonstrate at least 10 inserts and 5 extractions in a reproducible test run.

Expected Output
Sequence of heap states after operations (readable array/tree printout).
Log of priority computations for each request.
Evidence that higher-priority patients are consistently served first.
Deliverables for Module 3
Heap source code with comments.
Test driver producing the required logs and traces.
Brief written note on update strategy.

Module 4: Sorting Patient Records
Problem Description
At the end of the day, patient records must be sorted for reporting and analysis. You will implement two comparison-based sorting algorithms and compare their performance.
Tasks
Implementations
Merge Sort (top-down or bottom-up; justify choice).
Quick Sort (choose pivot strategy; justify and discuss its effect). Restrictions: Do not call language-provided sort utilities for core sorting logic.
Sort by treatment duration (minutes).

Dataset Sizes and Input Conditions:

Generate and sort datasets of size 100, 500, and 1000.
For each size, test three conditions: random, nearly sorted (≤10% elements
displaced), and reversed.
Use deterministic random seeds for reproducibility.

Analysis and Visualisation:
Present a table summarising times (and operation counts if collected).
Provide a brief analysis: where does each algorithm excel or degrade and why (pivot choice, recursion depth, cache effects).

Expected Output
Correctly sorted lists
Timing table (and, if available, plots) comparing merge sort and quick sort across input sizes and conditions.
Short written reflection on algorithm choice under different scenarios.
Deliverables for Module 4
Source code for merge sort and quick sort.
Benchmark script and results (tables and optional plots).
Brief write-up on stability and pivot strategy.

Reference no: EM133933054

Questions Cloud

What are effective ways to reduce your food packaging waste : What are effective ways to reduce your food packaging waste? How sustainable is the food packaging industry?
What are the contributions that peers offer to development : What are the contributions that peers offer to development of social and emotional competence? What activities in school might help a child grow in these areas
What were surprising findings associated with experiments : What were the surprising findings associated with the experiments with the women in the Telephone Relay Assembly Test Room?
How did approaching unpleasant thought way you did impact : How did approaching unpleasant thought the way you did impact the way you experienced what was happening in that moment? Did it impact your behavior?
Design and evaluate a hash table with collision handling : COMP5008 Data Structures and Algorithms, Curtin University - Critical Care Optimisation: Data Structures and Algorithms for Hospital Efficiency
What role does the creative process in art therapy play : What role does the creative process in Art Therapy play in enhancing the cognitive restructuring outcomes achieved through Cognitive Behavioral Therapy.
Identify research question in each and provide justification : Identify the research question in each and provide justification. Identify the methodological approach in each and provide justification.
What is the causal relationship between the two : You can identify the independent and dependent variables now what is the causal relationship between the two?
Describe typical motor development stage for that age group : Describe the typical motor development stage for that age group. Provide a real-world example of how motor skills are learned, practiced, or decline.

Reviews

Write a Review

Other Subject Questions & Answers

  Cross-cultural opportunities and conflicts in canada

Short Paper on Cross-cultural Opportunities and Conflicts in Canada.

  Sociology theory questions

Sociology are very fundamental in nature. Role strain and role constraint speak about the duties and responsibilities of the roles of people in society or in a group. A short theory about Darwin and Moths is also answered.

  A book review on unfaithful angels

This review will help the reader understand the social work profession through different concepts giving the glimpse of why the social work profession might have drifted away from its original purpose of serving the poor.

  Disorder paper: schizophrenia

Schizophrenia does not really have just one single cause. It is a possibility that this disorder could be inherited but not all doctors are sure.

  Individual assignment: two models handout and rubric

Individual Assignment : Two Models Handout and Rubric,    This paper will allow you to understand and evaluate two vastly different organizational models and to effectively communicate their differences.

  Developing strategic intent for toyota

The following report includes the description about the organization, its strategies, industry analysis in which it operates and its position in the industry.

  Gasoline powered passenger vehicles

In this study, we examine how gasoline price volatility and income of the consumers impacts consumer's demand for gasoline.

  An aspect of poverty in canada

Economics thesis undergrad 4th year paper to write. it should be about 22 pages in length, literature review, economic analysis and then data or cost benefit analysis.

  Ngn customer satisfaction qos indicator for 3g services

The paper aims to highlight the global trends in countries and regions where 3G has already been introduced and propose an implementation plan to the telecom operators of developing countries.

  Prepare a power point presentation

Prepare the power point presentation for the case: Santa Fe Independent School District

  Information literacy is important in this environment

Information literacy is critically important in this contemporary environment

  Associative property of multiplication

Write a definition for associative property of multiplication.

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