Monthly Archives: April 2017

  • 0
while loop

While Loop in C#

The while loop will check a condition and then continue to execute block of code as long as the condition  evaluates to a Boolean value of true. Its  syntax is as follow: while (<Boolean expression>) {<statement>} .The statements can be any valid in C# statements the Boolean expression is evaluate before any code in the following block has executed.

 

EXP –

 

Class While Loop

{

Public static void main ()

{

Int myInt  = 0;

While (my Int<10)

{

Console Write “{0}”,myint);

myInt++;

}

Console Write Line ();

}

}




  • 0
Deletion operation

Deletion Operation

Category : data structure

Before deletion operation we must check for emptiness of the queue. For the contiotion of the empty queue. when queue is empty.

Example-

 

Front ==+1

It also called queue underflow condition.

Int delete”(queue*qp)

{

Int   x;

If ( qp – front = =qp-rear+1)

Printf (“queue underflow condition “);

Else

{

X=qp- else [qp – front ++];

Return  x;

}

}


  • 0

Addition operation of Queue

Category : data structure

Before addiotion  opration we must check for fullness of the queue,the maximum valid value of rear pointer is max-1 if rear get this value the queue is full .it is also called queue overflow condition .

 

Void Add (queue*qp,int x)

{

If  (qp-rear==max-1)

Printf(“queue overflow”);

Else

Qp-else(++qp-rear)=x;

}