answersLogoWhite

0

Module Module1

Sub Main()

myQuequeue()

myStack()

Console.ReadLine()

End Sub

Private Sub myQuequeue()

Dim theQ As New Queue

Dim dStr, frmstrArr() As String

Dim i As Integer

frmstrArr = FillArr()

For i = 0 To 25

theQ.Enqueue(frmstrArr(i) + " queue")

Next

For i = 0 To 25

dStr = theQ.Dequeue()

Console.WriteLine(dStr)

Next

End Sub

Private Sub myStack()

Dim theStack As New Stack

Dim dStr, fStr() As String

Dim i As Integer

fStr = FillArr()

For i = 0 To 25

theStack.Push(fStr(i) + " stack")

Next

For i = 0 To 25

dStr = theStack.Pop()

Console.WriteLine(dStr)

Next

End Sub

Private Function FillArr()

Dim strArr(25) As String

strArr = New String() {"a", "b", "c", "d", "e", "f", "g", "h", "i", "j", "k", "l", "m", "n", "o", "p", "q", "r", "s", "t", "u", "v", "w", "x", "y", "z"}

Return strArr

End Function

end module

User Avatar

Wiki User

12y ago

What else can I help you with?

Related Questions

What is the importance of stack algorithm in your program?

Stack implementations allow us to easily implement backtracking algorithms.


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

stack abstract datatype


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.


Write a c program to perform stack operation?

int top=-1; int stack[10];


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

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


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


Write a program to convert stack into queue using c language?

In order to write a program to convert stack into queue using c language you must be able to identify the proper program. Having a special certification in programing will be beneficial as well to make sure you recognize the proper queues for the programs.


Write a c program to sort an unsorted stack?

A stack is implicitly sorted by hierarchical nested order. It does not make sense to sort a stack. Do you mean a list? If so, please ask the question again.


C program for insertion and deletion in stacks?

chk out the following link showing you how to implement stack. Though it is a c++ implementation it may still help you. http://thetechnofreaks.com/2011/10/26/4-creating-a-stack/#ixzz1bvp8FXdb


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 various ways to implement stack data structure?

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).


What is the difference between stack pointer and program counter?

The stack pointer keeps track of the top of the stack used by the current thread. The program counter keeps track of the next instruction in a program. Both are registers and both store a memory address.