Program to manipulate the data structure, Data Structure & Algorithms

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.

Posted Date: 3/19/2013 5:09:19 AM | Location : United States







Related Discussions:- Program to manipulate the data structure, Assignment Help, Ask Question on Program to manipulate the data structure, Get Answer, Expert's Help, Program to manipulate the data structure Discussions

Write discussion on Program to manipulate the data structure
Your posts are moderated
Related Questions
Prove that uniform cost search and breadth- first search with constant steps are optimal when used with the Graph-Search algorithm (see Figure). Show a state space with varying ste

#quCreate a flowchart to show the process that will allow the implementation of Queue, Enqueue, and Dequeue operations.estion..

Assume a complete binary tree T with n nodes where each node has an item (value). Label the nodes of the complete binary tree T from top to bottom & from left to right 0, 1, ..., n

Q. State the difference between a grounded header link list and a circular header link list?     Ans: A header linked list is a linked list which all the time c

find the grammar of regular expression of (a/?)(a/b)?

For the Oscillating sort to be applied, it is necessary for the tapes to be readable in both directions and able to be quickly reversed. The oscillating sort is superior to the po

Define null values.  In some cases a particular entity might not have an applicable value for an attribute or if we do not know the value of an attribute for a particular entit

Q.  In the given figure find the shortest path from A to Z using Dijkstra's Algorithm.    Ans: 1.  P=φ;  T={A,B,C,D,E,F,G,H,I,J,K,L,M,Z} Let L(A)

State the example of pre- and post-conditions Suppose that function f(x) should have a non-zero argument and return a positive value. We can document these pre- and post-condit

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