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
data structure for multiqueue

Q. Write down a non recursive algorithm to traverse a binary tree in order.                    Ans: N on - recursive algorithm to traverse a binary tree in inorder is as

write a algorithsm in c to perform push and pop operations stastic implementation using array ?

Example: Insertion of a key 33 into a B-Tree (w/split) Step 1: Search first node for key closet to 33. Key 30 was determined. Step 2: Node pointed through key 30, is se

Q. Write down an algorithm to insert a node in the beginning of the linked list.                         Ans: /* structure containing a link part and link part

Merge sort: Merge sort is a sorting algorithm that uses the idea of split and conquers. This algorithm splits the array into two halves, sorts them separately and then merges t

Write a recursive function the computes the number of digits in a positive integer n. For example if n = 6598, the function should return 4. Find a variant expression and a thresho

Ans: A procedure to reverse the singly linked list: reverse(struct node **st) { struct node *p, *q, *r; p = *st; q = NULL; while(p != NULL) { r =q;

Graph terminologies : Adjacent vertices: Two vertices a & b are said to be adjacent if there is an edge connecting a & b. For instance, in given Figure, vertices 5 & 4 are adj

(a) Explain the term Group Support System and elaborate on how it can improve groupwork. (b) Briefly explain three advantages of simulation. (c) Explain with the help of a