3. PSEUDO CODE
Pseudo means imitation and code refer to the instructions written in a programming
language.
Pseudo code is another programming analysis tools and its also called program design
language (PDL).
Pseudocode is an informal way of programming description that does not require any
strict programming language syntax or underlying technology considerations. It is used
for creating an outline or a rough draft of a program. Pseudocode summarizes a
program’s flow, but excludes underlying details. System designers write pseudocode to
ensure that programmers understand a software project's requirements and align
code accordingly.
4. PSEUDO CODE OF STACKS
Insert an element in stack.
Insertion(a,size)
full=size-1
If full then
print ‘STACK OVERFLOW’
exit
Else
Top=0 // stack empty
top=top+1
end if
a[top]=item
Exit
5. Delete an element from stack.
Deletion(item)
If top=0 then
print ‘STACK Empty’
exit
Else
Delete item
end if
top=top-1
Exit
6. Display element of stack.
Display()
If top=0 then
Print ‘STACK EMPTY’
Exit
Else
For i=top to 0
Print a[i]
End for
exit
7. PSEUDO CODE OF QUEUE
Insert an element in queue.
Insert rear()
[check for queue is over flow or not]
If (REAR >n) or (REAR==FRONT)
Print “queue is overflow”
else
// in next step
[enter the item]
QUEUE[REAR]=value
REAR=REAR+1
end
8. Delete an element in queue.
delete front()
[check for queue is under flow or not]
If front>N or front==Null
Print ”queue is empty”
else
// in next step
If front>rear
Front==null
Rear=-1
9. PSEUDO CODE OF CIRCULAR QUEUE
Enter item in Queue:
Check=Queue is full
if FRONT = 0 and REAR = N-1,
Queue =Overflow and Return
else
Set REAR = REAR + 1
Set QUEUE[REAR] = ITEM [This inserts new element]
Return
10. Delete item in queue
Check Queue empty
If FRONT = -1
Means ( Empty and Return)
Set ITEM = Queue[FRONT] //enter new value in FRONT)
If FRONT = REAR, then [Queue has only one element to start]
Set FRONT = -1 and REAR = -1
Else FRONT = N-1, then
Set FRONT = 0
11. PSEUDO CODE OF LIST
Inserting At Beginning of the list
Create a newNode
newNode → next = NULL.
If head== null then,
set head = newNode.
If head != null
temp =new node.
temp ->next=head
Head=temp
Set temp → next = newNode.
12. INSERTING AT END OF THE LIST
Create a newNode
If head == NULL
then
set newNode→next = NULL
head = newNode.
Else head != Null
temp = head
While temp->next != Null
Temp = temp-> next
Temp->next = newNode
newNode-> next=Null,
13. INSERTING AT CENTER OF THE LIST
newNode
Empty (head == NULL)
If it is Empty then, set newNode → next = NULL and head = newNode.
Index=1
Temp=head
Temp1=head
While index<=value
Temp=temp->next
Temp1=temp->next
Temp->next=newnode
newnode->next=temp1->next.
14. MAXIMUM VALUE IN THE ARRAY
SET Max to array[0]
FOR i = 1 to array length - 1
IF array[i] > Max THEN
SET Max to array[i]
ENDIF
ENDFOR
PRINT Max
15. ENTER VALUE IN THE ARRAY
Array[ size]
If size=array[size]-1
Array is full
Else
Array[size]++
16. REMOVE VALUE IN THE ARRAY
Array[ size]
If size=array[size]-1
Array is full
Else
Array[size]--