it in the fileThe next structure you will investigate is the Hash table and its methods implemented in pseudo code when linked lists are used to handle collisions. The task this week is to complete...

1 answer below »
it in the fileThe next structure you will investigate is the Hash table and its methods implemented in pseudo code when linked lists are used to handle collisions.

The task this week is to complete the pseudo code for the following hash table operations:



  1. Insert

  2. Remove


Assume Hashtable is a simple array of size 8, with indices 0..7. Numeric keys are mapped by a Hashfunction that gives the mod(8,n) value for any key “n” yielding the Hashtable index for that key (0..7). A Hashtable entry is null unless a key exists with that index as its hashed index; if so, the Hashtable entry points to the first node of a linked list of keys with that hash index. The last node on this linked list has a null reference for the next referenced node. Assume the occurrence of a linked list node is represented by the object “Node” and its “Data” and “NextRef” attributes.



Week 2 Deliverables:



  • 1 pseudo code implementation of each Hash table operation: Insert and Remove

  • Fully documented pseudo code.

  • Add the completed pseudo code and the output to the Key Assignment template Section 2: Hashing, Heaps and Trees.

  • Name the document "IT265__IP2.doc."



Please submit your assignment.




Assignment Description The next structure you will investigate is the Hash table and its methods implemented in pseudo code when linked lists are used to handle collisions. The task this week is to complete the pseudo code for the following hash table operations: 1. Insert 2. Remove Assume Hashtable is a simple array of size 8, with indices 0..7. Numeric keys are mapped by a Hashfunction that gives the mod(8,n) value for any key “n” yielding the Hashtable index for that key (0..7). A Hashtable entry is null unless a key exists with that index as its hashed index; if so, the Hashtable entry points to the first node of a linked list of keys with that hash index. The last node on this linked list has a null reference for the next referenced node. Assume the occurrence of a linked list node is represented by the object “Node” and its “Data” and “NextRef” attributes. Week 2 Deliverables: 1 pseudo code implementation of each Hash table operation: Insert and Remove Fully documented pseudo code. Add the completed pseudo code and the output to the Key Assignment template Section 2: Hashing, Heaps and Trees. Name the document "IT265__IP2.doc." Please submit your assignment.
Answered Same DayAug 25, 2021

Answer To: it in the fileThe next structure you will investigate is the Hash table and its methods implemented...

Arun Shankar answered on Aug 29 2021
164 Votes
Data Structures using Java document shell
Course number - course name
Project name
Student name
Date
Table of Contents
Abstract                                            2
Section 1: Lists, Stacks, and Queues                                3
Implement 2 programs for the following: Stacks and Queue
s
    Section 1.1 Stacks                                     3
    Section 1.2 Queues                                    5
Section 2: Hashing, Heaps and Trees
Implement pseudo code for a hash table and resolve collisions with a linked list.
    Section 2.1 Inserting and removing an element from a hash table                 7
Section 3: Sorting Algorithms
Compare sort algorithms.
Section 4: Searching
Implement pseudo code to search for values in a linked list or array.
Section 5: Recursion
Implement pseudo code to create a factorial of a number using recursion.
Abstract
TBD
Section 1: Lists, Stacks, and Queues
Let the linked list node be represented by the ‘Node’. Each ‘Node’ has a data item ‘Data’ of data type T and a ‘NextRef’ attribute pointing to the next node in the linked list.
class Node{
    T Data;        // The data item of a node.
    Node NextRef;    // link to the next Node in the list
}
We will implement stacks and queues using linked lists. The sub-sections below has the details of the implementations.
Section 1.1: Stacks

Assume a ‘Head’ Node exists with the NextRef attribute pointing to the first node in the stack or being null if the stack is empty. Given below is the pseudo code for the following 3 stack methods : push(item), pop( ) and display( ). Note that in the Java style pseudocodes given below, the top of the stack is the Node pointed to by ‘head’.
void push(T item)
{
// create a new 'Node' called newnode
// with item as the 'Data' and null as its 'NextRef'
Node newnode = new Node(item, null);

if(head==null)     // stack is empty
head = newnode;    // set the newnode as the ‘head’
else // stack is not empty
{
// push to the top of the stack
newnode.nextRef = head;        
head = newnode;    // the newnode is the new head
}
}
T pop()    // Note that the return type is T - the data type of ‘Data’
{
if(head==null) // stack is empty
return null;

// stack non-empty. Return the 'Data' of the head
// and set the head to head.nextRef
T topData = head.Data;
head = head.nextRef;
return topData;
}
void display()    // The display function prints the stack from top to bottom
{
if(head==null) // stack is empty
{
print("empty stack!");
return;
}
// Set...
SOLUTION.PDF

Answer To This Question Is Available To Download

Related Questions & Answers

More Questions »

Submit New Assignment

Copy and Paste Your Assignment Here