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

Array implementation of a dequeue, If a Dequeue is implemented via arrays, ...

If a Dequeue is implemented via arrays, then this will suffer with the similar problems which a linear queue had suffered. Program 8 gives the array implementation of Dequeue.

Define spanning tree, Define Spanning Tree A Spanning Tree of a connect...

Define Spanning Tree A Spanning Tree of a connected graph is its linked acyclic sub graph (i.e., a tree) that having all the vertices of the graph.

Tower of hanoi problem., Write an algorithm for getting solution to the Tow...

Write an algorithm for getting solution to the Tower's of Hanoi problem. Explain the working of your algorithm (with 4 disks) with appropriate diagrams. Ans: void Hanoi(int

Postfix expression algorithm, Write an algorithm to calculate a postfix exp...

Write an algorithm to calculate a postfix expression.  Execute your algorithm using the given postfix expression as your input : a b + c d +*f ↑ . T o evaluate a postfix expr

Frequency count, what is frequency count with examble? examble?

what is frequency count with examble? examble?

Define threaded binary tree, Threaded Binary Tree:- By changing the NUL...

Threaded Binary Tree:- By changing the NULL lines in a binary tree to special links known as threads, it is possible to perform traversal, insertion and deletion without using

Define prims algorithm, Define Prim's Algorithm Prim's  algorithm  is  ...

Define Prim's Algorithm Prim's  algorithm  is  a  greedy  algorithm  for  constructing  a  minimum  spanning  tree  of  a  weighted linked graph. It works by attaching to a bef

Procedure of analysis of algorithm, Example 1:  Following are Simple sequen...

Example 1:  Following are Simple sequence of statements Statement 1;  Statement 2; ... ... Statement k; The entire time can be found out through adding the times for

Demonstration of polynomial using linked list, Demonstration of Polynomial ...

Demonstration of Polynomial using Linked List # include # include Struct link { Char sign; intcoef; int expo; struct link *next; }; Typedefstruct link

Algorithm for similar binary tree, Q. The two Binary Trees are said to be s...

Q. The two Binary Trees are said to be similar if they are both empty or if they are both non- empty and left and right sub trees are similar. Write down an algorithm to determine

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