GeekInterview.com
   Home |  Tech FAQ  |   Interview Questions |  Placement Papers |  Tech Articles |  Learn |  Freelance Projects |  Online Testing |  Geeks Talk |  Job Postings |  Knowledge Base | Site Search |  Add/Ask Question

  GeekInterview.com  >  Interview Questions  >  Concepts  >  Data Structures

 Print  |  
Question:  Static Queue Items

Answer: Write an algorithm to calculate the number of items in a static queue?


April 04, 2009 12:07:42 #2
 piyushbeli   Member Since: September 2007    Total Comments: 4 

RE: Static Queue Items
 
F Front
R Rear
q array of queue
p pointer to array

if(F=Null)
return 0;
 
count=1
while(p!=R)
{
count++;
p=p+1;
}
     

 

Back To Question