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
graph prelim physics SELECT YEAR science CLASS 2004 2006 2010 RESULT 2009 computer CASE ICSE question paper 2007 UNION papers
Latest topics
» Nitration of aniline - IIT JEE 2018 Advanced - solved
algorithms in simple data structures..?? 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..?? EmptyFri Apr 06, 2018 1:05 am by adianadiadi

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

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

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

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

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

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

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

Top posters
abhas
algorithms in simple data structures..?? Vote_lcapalgorithms in simple data structures..?? Voting_baralgorithms in simple data structures..?? Vote_rcap 
Anu..i luv icse...:)
algorithms in simple data structures..?? Vote_lcapalgorithms in simple data structures..?? Voting_baralgorithms in simple data structures..?? Vote_rcap 
G-7
algorithms in simple data structures..?? Vote_lcapalgorithms in simple data structures..?? Voting_baralgorithms in simple data structures..?? Vote_rcap 
siya
algorithms in simple data structures..?? Vote_lcapalgorithms in simple data structures..?? Voting_baralgorithms in simple data structures..?? Vote_rcap 
Candy
algorithms in simple data structures..?? Vote_lcapalgorithms in simple data structures..?? Voting_baralgorithms in simple data structures..?? Vote_rcap 
jOhNy
algorithms in simple data structures..?? Vote_lcapalgorithms in simple data structures..?? Voting_baralgorithms in simple data structures..?? Vote_rcap 
Apurva
algorithms in simple data structures..?? Vote_lcapalgorithms in simple data structures..?? Voting_baralgorithms in simple data structures..?? Vote_rcap 
WinRrule
algorithms in simple data structures..?? Vote_lcapalgorithms in simple data structures..?? Voting_baralgorithms in simple data structures..?? Vote_rcap 
ambili
algorithms in simple data structures..?? Vote_lcapalgorithms in simple data structures..?? Voting_baralgorithms in simple data structures..?? Vote_rcap 
saif
algorithms in simple data structures..?? Vote_lcapalgorithms in simple data structures..?? Voting_baralgorithms in simple data structures..?? 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 : 1, 2  Next
AuthorMessage
sim27in

sim27in


algorithms in simple data structures..?? Vide
PostSubject: algorithms in simple data structures..?? algorithms in simple data structures..?? EmptyThu Mar 18, 2010 10:34 pm

does ny1 hv easier algortihms of push,pop....etc...coz d ones in sumita arora r kinda difficult to understand....???
Back to top Go down
G-7
Active member
Active member
G-7


algorithms in simple data structures..?? Vide
PostSubject: Re: algorithms in simple data structures..?? algorithms in simple data structures..?? EmptyThu Mar 18, 2010 10:37 pm

To be frank to u brother...those ar the easiest..! trust me..!
Back to top Go down
sim27in

sim27in


algorithms in simple data structures..?? Vide
PostSubject: Re: algorithms in simple data structures..?? algorithms in simple data structures..?? EmptyThu Mar 18, 2010 10:40 pm

ohk...firstly...im a gal...

well...then...bro if they r d easiest....
cn u try n explain ny 1 of dem...??
id be grateful...
Back to top Go down
G-7
Active member
Active member
G-7


algorithms in simple data structures..?? Vide
PostSubject: Re: algorithms in simple data structures..?? algorithms in simple data structures..?? EmptyThu Mar 18, 2010 10:59 pm

eh..? sorry.. i didnt bother to chck ur profile..cuz..im..er..anyway.,..sorry..!

I'll explain the Deletion in a Stack - popping.
If we consider an array of max N elemnts. First we initialise the control variable ctr to top.

ctr = top;
and w're printing the element.now there is a vacant pos at the top. as the elements are poped out frm the top. Now we are pulling the second element to th top and the other elements to the positon just aboove them.

Stack[ctr]=Stack[ctr++]

thats all...!!

If u can undrstand this try using the same mode of thought and try to understand the others too.! If u get any doubt juz ask me.
Back to top Go down
sim27in

sim27in


algorithms in simple data structures..?? Vide
PostSubject: Re: algorithms in simple data structures..?? algorithms in simple data structures..?? EmptyThu Mar 18, 2010 11:04 pm

ohk...dis seems easy...
thx nyway....

n wats d diff btw deletion in a stack(as an array)....n deletion in a stack(as a linkd list)..??
Back to top Go down
G-7
Active member
Active member
G-7


algorithms in simple data structures..?? Vide
PostSubject: Re: algorithms in simple data structures..?? algorithms in simple data structures..?? EmptyThu Mar 18, 2010 11:12 pm

You know array is contigous...while a linked list is "linked"..! One node's link part referenced to the Data part of the next one. There are no top or bottom in LL..only last and first. So...if we are deleting ANY node, which we cannot do in Stack Array...! In that LIFO principle is followed. Last In First Out...adn if u want to pop out the middle element u have no way but to pop out all the elements above it.!

But in LL, u can delete any node irrespective of its' position and after u delete a node u have to link the node preceding the deleted node to the node succeeding the deleted node.!!

Thats just a simple differece.

Any more? Im going to take my dinner. I'm starving. So.will be back after 15 mts.

bye


Peace..!
Back to top Go down
sim27in

sim27in


algorithms in simple data structures..?? Vide
PostSubject: Re: algorithms in simple data structures..?? algorithms in simple data structures..?? EmptyThu Mar 18, 2010 11:14 pm

ya...ok...hv ur dinner..
till den ill try to understand it...
thx..!
Back to top Go down
G-7
Active member
Active member
G-7


algorithms in simple data structures..?? Vide
PostSubject: Re: algorithms in simple data structures..?? algorithms in simple data structures..?? EmptyThu Mar 18, 2010 11:30 pm

Hi..!
Back to top Go down
diptojit
Active member
Active member



algorithms in simple data structures..?? Vide
PostSubject: Re: algorithms in simple data structures..?? algorithms in simple data structures..?? EmptyThu Mar 18, 2010 11:36 pm

hey guyzz...howzz the preparations for computer going on.......as for me, I'm getting screwed by section C...... algorithms in simple data structures..?? Icon_biggrin
Back to top Go down
G-7
Active member
Active member
G-7


algorithms in simple data structures..?? Vide
PostSubject: Re: algorithms in simple data structures..?? algorithms in simple data structures..?? EmptyThu Mar 18, 2010 11:37 pm

Quite well...! What are u getting pinned at..??
Back to top Go down
diptojit
Active member
Active member



algorithms in simple data structures..?? Vide
PostSubject: Re: algorithms in simple data structures..?? algorithms in simple data structures..?? EmptyThu Mar 18, 2010 11:39 pm

linked lists........
Back to top Go down
diptojit
Active member
Active member



algorithms in simple data structures..?? Vide
PostSubject: Re: algorithms in simple data structures..?? algorithms in simple data structures..?? EmptyThu Mar 18, 2010 11:40 pm

Hey man can u check a program on deque for me ??....the one given in the sample paper...
here it is....on my own logic.....

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)||(front==0&&rear==0))
{ ele[--front]=v;
}
else
{ System.out.println("Full from front");
}
}
int pop()
{ if(front==0&&rear==0)
{ return 999;
}
else
{ ++front;
return(ele[front-1]);
}
}
void pushrear(int v)
{ if(rear==cap-1)
{ System.out.println("Full from rear");
}
else
{ ele[++rear]=v;
}
}
int poprear()
{ if(front==0&&rear==0)
{ return 999;}
else
{ --rear;
return(ele[rear+1]);
}
}
}
Back to top Go down
G-7
Active member
Active member
G-7


algorithms in simple data structures..?? Vide
PostSubject: Re: algorithms in simple data structures..?? algorithms in simple data structures..?? EmptyThu Mar 18, 2010 11:48 pm

i found a bug in the initial part.

void pushfront(int v)
{ if((front>0)||(front==0&&rear==0))
{ ele[--front]=v;
}

if front = rear = 0 ie one element in deque then ele[-1]would be initialised to v..?

a negative index would cause a runtime exception...
Back to top Go down
sim27in

sim27in


algorithms in simple data structures..?? Vide
PostSubject: Re: algorithms in simple data structures..?? algorithms in simple data structures..?? EmptyFri Mar 19, 2010 12:00 am

hey wat progs do u think r important...??
r inheritance,recursion,linkd list progs sure to come...??
or wud it be easy like previous years..??? ny idea...???
Back to top Go down
diptojit
Active member
Active member



algorithms in simple data structures..?? Vide
PostSubject: Re: algorithms in simple data structures..?? algorithms in simple data structures..?? EmptyFri Mar 19, 2010 12:01 am

ur right....here's a new version of the pushfront()

void pushfront(int v)
{ if(front>0)
{ ele[--front]=v;
}
else if(front==0&&rear==0)
{ ele[0]=v;}
else
{ System.out.println("Full from front");
}
}
Back to top Go down
diptojit
Active member
Active member



algorithms in simple data structures..?? Vide
PostSubject: Re: algorithms in simple data structures..?? algorithms in simple data structures..?? EmptyFri Mar 19, 2010 12:03 am

is the pop part okk dude ??
@ sim27:inheritance and recursion are definitely coming...hope the paper's gonna be easy....only time will tell.....
Back to top Go down
G-7
Active member
Active member
G-7


algorithms in simple data structures..?? Vide
PostSubject: Re: algorithms in simple data structures..?? algorithms in simple data structures..?? EmptyFri Mar 19, 2010 12:04 am

i really pray that it wud be easy..! but nothng cud be taken for granted. I am not blindly expecting anythng....just hoping that whatever it is...i can do it..!!!

anyway..all the best everybody...!
Back to top Go down
G-7
Active member
Active member
G-7


algorithms in simple data structures..?? Vide
PostSubject: Re: algorithms in simple data structures..?? algorithms in simple data structures..?? EmptyFri Mar 19, 2010 12:05 am

gimme a little more time...!! im checkng..!
Back to top Go down
diptojit
Active member
Active member



algorithms in simple data structures..?? Vide
PostSubject: Re: algorithms in simple data structures..?? algorithms in simple data structures..?? EmptyFri Mar 19, 2010 12:06 am

the pop part has a little problem....just that it's not popping.....lolzzz...gotta check that out......
Back to top Go down
diptojit
Active member
Active member



algorithms in simple data structures..?? Vide
PostSubject: Re: algorithms in simple data structures..?? algorithms in simple data structures..?? EmptyFri Mar 19, 2010 12:08 am

yeah man sure !!!
Back to top Go down
G-7
Active member
Active member
G-7


algorithms in simple data structures..?? Vide
PostSubject: Re: algorithms in simple data structures..?? algorithms in simple data structures..?? EmptyFri Mar 19, 2010 12:10 am

dude..tha same part...what happens to the original ele[front] when u push a new one..???

it gets ovr written ... doesnt it..? and still there remains only one element. which contradicts the case that the deque shud get longer as we add elements...
Back to top Go down
diptojit
Active member
Active member



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

hey the program's working cool...I just finished checking......actually when I was printing I forgot to take front and rear as the lower and upper limits and was rather printing the whole array out....stupid me !!! algorithms in simple data structures..?? Icon_mad .....newayzz....lemme know if you find some mistake....cheers !!!....at last it seems I'm getting into 'queues'......
Back to top Go down
diptojit
Active member
Active member



algorithms in simple data structures..?? Vide
PostSubject: Re: algorithms in simple data structures..?? algorithms in simple data structures..?? EmptyFri Mar 19, 2010 12:15 am

nawhh it's not getting overwritten...I'm not shifting elements here...I'm just changing the front and rear index...and when the front is full there can't be any addition in the front...that happens in a stack.....this is a deque..isn't it ??
Back to top Go down
G-7
Active member
Active member
G-7


algorithms in simple data structures..?? Vide
PostSubject: Re: algorithms in simple data structures..?? algorithms in simple data structures..?? EmptyFri Mar 19, 2010 12:16 am

dude.. the pop part doesnt work because the push part is not correct.. there is only one element all the time in the deque...and also when u r poping u r not printin the value but 999

if(front==0&&rear==0)
{ return 999;

only this part is repeating as there is only one element..and the reason is cited ealier in this post..!
Back to top Go down
G-7
Active member
Active member
G-7


algorithms in simple data structures..?? Vide
PostSubject: Re: algorithms in simple data structures..?? algorithms in simple data structures..?? EmptyFri Mar 19, 2010 12:18 am

thre are two types of deque...input controlled and outpput controlled...

the input restricted only allows isertion at one end but deletion at both ends...

but the output restricted allows deletionat one end only and insertion at both ends..!

urs is wich type..?
Back to top Go down
Sponsored content




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

Back to top Go down

algorithms in simple data structures..??

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

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-