100% de satisfacción garantizada Inmediatamente disponible después del pago Tanto en línea como en PDF No estas atado a nada 4,6 TrustPilot
logo-home
Examen

CS 300 – Analysis & Design | Assignment 4-2 – Hash Tables |SNHU| – Pseudocode, Reflection, and Complete C++ Code| Grade A

Puntuación
-
Vendido
-
Páginas
10
Grado
A
Subido en
28-12-2025
Escrito en
2025/2026

This document covers CS 300 Assignment 4-2 and focuses on implementing a hash table to store, search, display, and remove bid records loaded from a CSV file. It includes structured pseudocode, a written reflection, and full C++ source code demonstrating hashing, collision handling with chaining, and efficient data retrieval. The assignment highlights modular design, defensive programming, and performance considerations when working with dynamic data structures.

Mostrar más Leer menos
Institución
Analysis & Design
Grado
Analysis & Design









Ups! No podemos cargar tu documento ahora. Inténtalo de nuevo o contacta con soporte.

Escuela, estudio y materia

Institución
Analysis & Design
Grado
Analysis & Design

Información del documento

Subido en
28 de diciembre de 2025
Número de páginas
10
Escrito en
2025/2026
Tipo
Examen
Contiene
Preguntas y respuestas

Temas

Vista previa del contenido

Assignment 4-2 Hash Tables

Pseudo code
MAIN PROGRAM
Set default CSV path and bid key.
Create a new HashTable object.
Display menu until user chooses Exit:
If user selects Load Bids:
Call loadBids(csvPath, hashTable)
If user selects Display All Bids:
Call hashTable.PrintAll()
If user selects Find Bid:
Call hashTable.Search(bidKey)
Display result if found
If user selects Remove Bid:
Call hashTable.Remove(bidKey)

FUNCTION loadBids(csvPath, hashTable)
Display message indicating file load attempt.

Open CSV file using parser.
For each row in the file:
Create new Bid
Extract bidId, title, fund, and amount
Insert bid into hash table
CLASS HashTable
FUNCTION Insert(bid)
Compute key using hash(bidId)
If bucket is empty:
Store bid at bucket
Else:
Traverse linked list
Add new node at end
FUNCTION Search(bidId)
Compute key
Traverse list at bucket
If bidId matches, return bid
Else return empty bid
FUNCTION Remove(bidId)
Compute key
Traverse list to locate matching bid
If found:
Remove node and adjust links

FUNCTION PrintAll

, For each bucket:
Traverse nodes and print bid data


2. Reflection

Developing this program allowed me to deepen my understanding of how hash tables
function. Also it helped me understand how important design decisions, such as collision
handling and hashing strategy can impact performance and reliability. One of the main
challenges I encountered was ensuring that the CSV file loaded correctly, especially when
the file path was incorrect or the file was not stored in the expected directory. This
produced runtime errors from the CSV parser, which I fixed by adding a file-existence check
and improving exception handling. These issues helped me to reinforce the value of
defensive programming and the importance of validating assumptions before processing
data.

Another key part of the assignment was improving modularity and readability. Separating
the hash table operations into clearly defined methods made the code easier to understand,
debug, and reuse. Consistent naming conventions, comments, and whitespace helped keep
the logic organized and clear for future maintenance. Therefore, completing this project
strengthened my ability to design data structures in a modular way and taught me how to
debug more effectively when working with external data and dynamic memory.


3. Code

//========================================================================
====
// Name : HashTable.cpp
// Author : TESTBANKSNERD
// Version : 1.0
// Copyright : Copyright � 2023 SNHU COCE
// Description : Lab 4-2 Hash Table
//========================================================================
====

#include <algorithm>
#include <climits>
#include <iostream>
#include <string>
#include <time.h>
#include "CSVparser.hpp"

using namespace std;

const unsigned int DEFAULT_SIZE = 179;

// Forward declaration
$14.99
Accede al documento completo:

100% de satisfacción garantizada
Inmediatamente disponible después del pago
Tanto en línea como en PDF
No estas atado a nada


Documento también disponible en un lote

Conoce al vendedor

Seller avatar
Los indicadores de reputación están sujetos a la cantidad de artículos vendidos por una tarifa y las reseñas que ha recibido por esos documentos. Hay tres niveles: Bronce, Plata y Oro. Cuanto mayor reputación, más podrás confiar en la calidad del trabajo del vendedor.
TestbanksNerd Ohio State University College Of Medicine
Seguir Necesitas iniciar sesión para seguir a otros usuarios o asignaturas
Vendido
71
Miembro desde
1 año
Número de seguidores
0
Documentos
429
Última venta
1 día hace
TestBanks Nerd

Welcome to TestBanks Nerd – the ultimate hub for academic resources. Here, you’ll find a wide selection of test banks, solution manuals, study notes, lecture summaries, practice exams, and past papers carefully curated to help students succeed. Whether you’re preparing for an exam, revising core concepts, or looking for step-by-step solutions, this store provides accurate, reliable, and exam-focused materials across multiple subjects and editions. At TestBanks Nerd, we make studying smarter, faster, and easier.

Lee mas Leer menos
3.8

12 reseñas

5
6
4
1
3
2
2
2
1
1

Recientemente visto por ti

Por qué los estudiantes eligen Stuvia

Creado por compañeros estudiantes, verificado por reseñas

Calidad en la que puedes confiar: escrito por estudiantes que aprobaron y evaluado por otros que han usado estos resúmenes.

¿No estás satisfecho? Elige otro documento

¡No te preocupes! Puedes elegir directamente otro documento que se ajuste mejor a lo que buscas.

Paga como quieras, empieza a estudiar al instante

Sin suscripción, sin compromisos. Paga como estés acostumbrado con tarjeta de crédito y descarga tu documento PDF inmediatamente.

Student with book image

“Comprado, descargado y aprobado. Así de fácil puede ser.”

Alisha Student

Preguntas frecuentes