answersLogoWhite

0


Best Answer


2. Write a program using switch statement that reads a character representing a geometrical figure, then asks the user to enter the required data (ex. Radius for a circle, length and height for a rectangle, etc. ...) . The program should then print the area and circumference.
Figures are: circle(c), square(s), rectangle(r), triangle (t).

User Avatar

Wiki User

14y ago
This answer is:
User Avatar

Add your answer:

Earn +20 pts
Q: Write various ways to implement stack data structure?
Write your answer...
Submit
Still have questions?
magnify glass
imp
Related questions

Explain The merits of using a deque to implement a stack in data structure?

Explain The merits of using a deque to implement a stack in data structure


Can heap implement recursion?

Heap is a data-structure, it cannot implement anything. On the other hand, it is true that: 1. Recursive routines might use heap. 2. You can use dynamic memory allocation (heap), to implement a stack; and use the stack to implement recursion.


Write a java program to implement stack in java?

You would need an array to store the actual stack. Better use an ArrayList or some other structure that you can redimension. You'll also need a variable to point to the "top of stack" - the last element added, which is the first element to be taken away.


How do you implement stack without array?

Stacks are often implemented using the same node structure as a linked list.


Is it possible to implement stack and queues using linkes list?

Yes it is possible to implement stack and queue using linked list


Can implement circular lists using stack?

No. A stack is a data structure that allows insertion and removal at the top. A circular list allows insertion and removal anywhere in the list. The two types of data structure are too different to be reasonably implementable in terms of each other.


What is the importance of stack algorithm in your program?

Stack implementations allow us to easily implement backtracking algorithms.


What are application of stack?

Stacks are primarily used to implement backtracking algorithms.


C program to implement tower of hanoi using array implementation of stack abstract datatype?

stack abstract datatype


Is there any way to perform quick sort other than stack?

Stack is not a way to perform quicksort, it is a tool used to implement recursion.


A stack class template in C?

I didnt get exactly what do you mean by stack class template, but this is one which implements a stack! and also shows how to implement it with templates http://thetechnofreaks.com/2011/10/26/4-creating-a-stack/#ixzz1bvq2V1Ws


What is the relationship between a stack and an array?

There is no inherent relationship between the two. It's possible to implement a stack using an array to store date, but that's about it.