Complete IIT AIEEE ICSE ISC PMT help forum
This is a free help Forum for Indian Students.
Complete IIT AIEEE ICSE ISC PMT help forum
This is a free help Forum for Indian Students.
Complete IIT AIEEE ICSE ISC PMT help forum
Would you like to react to this message? Create an account in a few clicks or log in to continue.
Complete IIT AIEEE ICSE ISC PMT help forum

Complete help forum for students preparing for icse iit aieee cbse pmt and other related exams.Stay updated about all 2011 exams.
 
HomeHome  PortalPortal  SearchSearch  Latest imagesLatest images  RegisterRegister  Log in  India NewsIndia News  
Keywords
question physics papers paper ICSE computer CASE UNION SELECT YEAR prelim graph 2009 CLASS science 2007 2004 RESULT 2006 2010
Latest topics
» Nitration of aniline - IIT JEE 2018 Advanced - solved
algorithms in simple data structures..?? - Page 2 EmptyFri Jun 08, 2018 2:34 am by adianadiadi

» Diamagnetic - Paramagnetic - Ni(CO)4, [Ni(CN)4]2- and [NiCl4
algorithms in simple data structures..?? - Page 2 EmptyFri Apr 06, 2018 1:05 am by adianadiadi

» IIT JEE chemistry solved interactive question paper
algorithms in simple data structures..?? - Page 2 EmptySun Oct 29, 2017 12:11 pm by adianadiadi

» IIT JEE 2015 SOLVED QUESTION PAPER
algorithms in simple data structures..?? - Page 2 EmptyWed Oct 19, 2016 1:44 pm by adianadiadi

» IIT JEE chemistry solved questions
algorithms in simple data structures..?? - Page 2 EmptySat Jul 18, 2015 6:15 pm by adianadiadi

» General Description of Chinese Market for Foaming Agent ADC
algorithms in simple data structures..?? - Page 2 EmptyFri May 09, 2014 2:09 pm by happybaicaitou

» How to get Lowest Cost MBBS Admission?
algorithms in simple data structures..?? - Page 2 EmptyMon Feb 24, 2014 6:39 pm by MENTOR 2014

»  girl boy vashikaran specialist agori baba ji +91-9461165
algorithms in simple data structures..?? - Page 2 EmptyTue Jan 21, 2014 6:00 pm by krshastri

»  STRONG LOST LOVE SPELL +91-9461165176
algorithms in simple data structures..?? - Page 2 EmptyTue Jan 21, 2014 6:00 pm by krshastri

Top posters
abhas
algorithms in simple data structures..?? - Page 2 Vote_lcapalgorithms in simple data structures..?? - Page 2 Voting_baralgorithms in simple data structures..?? - Page 2 Vote_rcap 
Anu..i luv icse...:)
algorithms in simple data structures..?? - Page 2 Vote_lcapalgorithms in simple data structures..?? - Page 2 Voting_baralgorithms in simple data structures..?? - Page 2 Vote_rcap 
G-7
algorithms in simple data structures..?? - Page 2 Vote_lcapalgorithms in simple data structures..?? - Page 2 Voting_baralgorithms in simple data structures..?? - Page 2 Vote_rcap 
siya
algorithms in simple data structures..?? - Page 2 Vote_lcapalgorithms in simple data structures..?? - Page 2 Voting_baralgorithms in simple data structures..?? - Page 2 Vote_rcap 
Candy
algorithms in simple data structures..?? - Page 2 Vote_lcapalgorithms in simple data structures..?? - Page 2 Voting_baralgorithms in simple data structures..?? - Page 2 Vote_rcap 
jOhNy
algorithms in simple data structures..?? - Page 2 Vote_lcapalgorithms in simple data structures..?? - Page 2 Voting_baralgorithms in simple data structures..?? - Page 2 Vote_rcap 
Apurva
algorithms in simple data structures..?? - Page 2 Vote_lcapalgorithms in simple data structures..?? - Page 2 Voting_baralgorithms in simple data structures..?? - Page 2 Vote_rcap 
WinRrule
algorithms in simple data structures..?? - Page 2 Vote_lcapalgorithms in simple data structures..?? - Page 2 Voting_baralgorithms in simple data structures..?? - Page 2 Vote_rcap 
ambili
algorithms in simple data structures..?? - Page 2 Vote_lcapalgorithms in simple data structures..?? - Page 2 Voting_baralgorithms in simple data structures..?? - Page 2 Vote_rcap 
saif
algorithms in simple data structures..?? - Page 2 Vote_lcapalgorithms in simple data structures..?? - Page 2 Voting_baralgorithms in simple data structures..?? - Page 2 Vote_rcap 



Search if you can't find it here

algorithms in simple data structures..??

View previous topic View next topic Go down
Go to page : Previous  1, 2
AuthorMessage
diptojit
Active member
Active member



algorithms in simple data structures..?? - Page 2 Vide
PostSubject: Re: algorithms in simple data structures..?? algorithms in simple data structures..?? - Page 2 EmptyFri Mar 19, 2010 12:24 am

don't know.....this is the program from the sample paper....I don't think the sample question is exactly on a deque....
Back to top Go down
diptojit
Active member
Active member



algorithms in simple data structures..?? - Page 2 Vide
PostSubject: Re: algorithms in simple data structures..?? algorithms in simple data structures..?? - Page 2 EmptyFri Mar 19, 2010 12:26 am

anyways... i checked it out and it's working fine now.....I created a main method to check it....have a look...

here's the newer version of the program....along with the main method

import java.io.*;
class chain
{ int ele[];
int cap,front,rear;
chain(int max)
{ cap=max;
front=0;rear=0;
ele=new int[cap];
}
void pushfront(int v)
{ if(front>0)
{ ele[front-1]=v;
front--;
}
else if(front==0&&rear==0)
{ ele[0]=v;}
else
{ System.out.println("Full from front");
}
}
int popfront()
{ if(front==0&&rear==0)
{ return 999;
}
else
{ front=front+1;
return(ele[front-1]);
}
}
void pushrear(int v)
{ if(rear==cap-1)
{ System.out.println("Full from rear");
}
else
{ ele[rear+1]=v;
rear++;
}
}
int poprear()
{ if(front==0&&rear==0)
{ return 999;}
else
{ rear=rear-1;
return(ele[rear+1]);
}
}
void display()
{ int i;
for(i=front;i<=rear;i++)
{ if(ele[i]!=0)
{ System.out.print(ele[i]+" ");
}
}
}
}
test class :-
import java.io.*;
class test
{ void main()throws IOException
{
chain obj=new chain(10);
obj.pushfront(5);
obj.pushrear(Cool;
obj.pushrear(13);
obj.display();
System.out.println();
obj.popfront();
obj.display();
System.out.println();
obj.pushrear(1);
obj.display();
System.out.println();
obj.poprear();
obj.display();
System.out.println();
}
}
Back to top Go down
G-7
Active member
Active member
G-7


algorithms in simple data structures..?? - Page 2 Vide
PostSubject: Re: algorithms in simple data structures..?? algorithms in simple data structures..?? - Page 2 EmptyFri Mar 19, 2010 12:27 am

yea..there is no application for deque for us to study... jus the theory... jus superficial...! but i like to do it cuz itz challenging... maybe we can do a code during the holidays.!
Back to top Go down
G-7
Active member
Active member
G-7


algorithms in simple data structures..?? - Page 2 Vide
PostSubject: Re: algorithms in simple data structures..?? algorithms in simple data structures..?? - Page 2 EmptyFri Mar 19, 2010 12:30 am

nay.. a small bug still there...try poppin from the front...after pushing front...!
Back to top Go down
G-7
Active member
Active member
G-7


algorithms in simple data structures..?? - Page 2 Vide
PostSubject: Re: algorithms in simple data structures..?? algorithms in simple data structures..?? - Page 2 EmptyFri Mar 19, 2010 12:42 am

All the best everyone....may God help u and also me.. Very Happy

I'll pray thay every one of us can get good marks and w can do the xam very well..!!

G0od night everyone..!

ALL IZZ WELL...!!!
Back to top Go down
Sponsored content




algorithms in simple data structures..?? - Page 2 Vide
PostSubject: Re: algorithms in simple data structures..?? algorithms in simple data structures..?? - Page 2 Empty

Back to top Go down

algorithms in simple data structures..??

View previous topic View next topic Back to top
Page 2 of 2Go to page : Previous  1, 2

Permissions in this forum:You cannot reply to topics in this forum
Complete IIT AIEEE ICSE ISC PMT help forum :: ISC :: ISC 2010 [Class xii] :: Computer-