Program to manipulate the data structure, Data Structure & Algorithms

Assignment Help:

Data Structure and Methods:

  • Build an array structure to accomodate at least 10 elements. Provide routines for the following:
  • An initializer.
  • A routine to populate (add an element) to the first available slot,
  • A routine to delete (remove an element) from a chosen slot,
  • A routine to display the number of filled slots,
  • A routine to show the maximum number of slots,
  • A routine to query the contents of a slot,
  • A routine to update the information in a slot,
  • Test for full and empty conditions of the Array.

Testing:

Write (a) program(s) that tests each of the methods used to manipulate the data structure:

  • Construction.
  • Populate the available slots until the structure is full, then attempt to add one more.
  • Query the contents of a all slots.
  • Remove the contents of a given slot.
  • Update the contents of a slot.
  • Deplete the structure until all slots are empty, then attempt to delete another .

When displaying the full structure use a loop that shows 1 slot and its content, at a time.

Your program should employ a simple menu that repeatedly prompts the user to perform the functions.

Example: Enter an Request Type

1 To add elements in to the Array (until 1 or null)

2 To remove an element out of the Array

3 To display the contents of the entire Array

4 To query the count of occupied slots

5 - To query the maximum number of slots

6 To update an Array slot with a new information value

7 To find the location of a given value

8 Exit

Show all inputs, outputs, explanation of return codes, and informational messages.


Related Discussions:- Program to manipulate the data structure

Representation of data structure in memory, Representation of data structur...

Representation of data structure in memory is known as: Abstract data type

Insertion into a red-black tree, The insertion procedure in a red-black tre...

The insertion procedure in a red-black tree is similar to a binary search tree i.e., the insertion proceeds in a similar manner but after insertion of nodes x into the tree T, we c

Insert an element after an element pointed by some pointer, Consider a link...

Consider a linked list of n elements. What is the time taken to insert an element after an element pointed by some pointer? O (1)

Explain linked list, Linked List  A linked list is a linear collection...

Linked List  A linked list is a linear collection of data elements called nodes. The linear order is given by pointer. Every node is divided into 2 or more parts.

Sort wars - sorting algorithm, If quicksort is so quick, why bother with an...

If quicksort is so quick, why bother with anything else? If bubble sort is so bad, why even mention it? For that matter, why are there so many sorting algorithms? Your mission (sho

Cohen sutherland algorithm, Using the cohen sutherland. Algorithm. Find the...

Using the cohen sutherland. Algorithm. Find the visible portion of the line P(40,80) Q(120,30) inside the window is defined as ABCD A(20,20),B(60,20),C(60,40)and D(20,40)

Multiple stack, implement multiple stack in single dimensionl array.write a...

implement multiple stack in single dimensionl array.write algorithms for various stack operation for them

Two-dimensional array, Two-dimensional array is shown in memory in followin...

Two-dimensional array is shown in memory in following two ways:  1.  Row major representation: To achieve this linear representation, the first row of the array is stored in th

Cache simulator, how to design a cache simulator with 4-way set associative...

how to design a cache simulator with 4-way set associative cache

Depth of complete binary tree, What will be depth do , of complete binary t...

What will be depth do , of complete binary tree of n nodes, where nodes are labelled from 1 to n with root as node and last leaf node as node n

Write Your Message!

Captcha
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