PSEUDOCODE Flashcards
How to open & close a file
OPENFILE “filname.txt” FOR WRITE/READ/APPEND
CLOSFILE “Namefile.txt”
How to write and read from a file
WRTIEFILE “Namefile.txt”, “What do you whant to write”
READFILE”Namefile.txt”, Variable_name
How to declare constant
CONSTANT variablename = 60
How to declare arrey
DECLARE Arreyname : ARRAY[1:60] OF STRING
How to declare integer
DECLARE variablename : INTEGER
Explain how a new elemment can be added to the queue if it is implemented using two stacks
Two stacks are required so the second stack can reverse the order of the first stack
stack 1 operates as the queue with the newest elemnts at the bottom. stack 2 is empty
To add an element, pop all the elements from stack 1 and push onto stack 2
Push the new elements onto either stack
Pop all the elements of stack 2 back onto stack 1