LED PANEL

Google It, You'll Get It.

Monday, March 28, 2011

Stack - Real Life Example - Idly Maker




Source : http://www.tastypalettes.com/2008/02/pillows-of-heaven.html

EBook to learn stacks _ Free

Title : Stack Computers: the new wave
Author : Philip J. Koopman, Jr.


Link to Download : http://www.ece.cmu.edu/~koopman/stack_computers/stack_computers.zip


i hope this will be a very useful for the people who are learning stacks.

Stack - Real Life Example - Cafeteria tray example




Source : http://www.ece.cmu.edu/~koopman/stack_computers/sec1_2.html

Stacks - Introduction

-Stack is the First Data Structure in Programming.

-It is a method where we use LIFO ( LAST IN - FIRST OUT ).

LIFO stacks, also known as "push down" stacks, are the conceptually simplest way of saving information in a temporary storage location for such common computer operations as mathematical expression evaluation and recursive subroutine calling.

-It has only two fundamental operations called PUSH and POP.

--PUSH > to insert an element ( to the top )
The push operation adds an item to the top of the stack,
hiding any items already on the stack, or initializing the stack if it is empty.

--POP > to remove an element ( from the top )
The pop operation removes an item from the top of the stack, and returns this value to the caller. A pop either reveals previously concealed items, or results in an empty stack.

Next > > >

I think now its time for me to move into Stacks and Queues..

Saturday, February 5, 2011

String starting with 'b; in a given series of strings


header file stdio.h
header file string.h


main()

{
int i;
const int stringLimit = 5;

char s[stringLimit][50]; //row and column

printf("enter the strings \n");
for(i=0;i gets(s[i]);

/*for(i=0;i // if(str[i][0]=='b';
printf("str %s \n",s[i]);*/

printf("\n strings Starting wIth letter 'b' \n");
for(i=0;i if(s[i][0]=='b')
printf("word %d : %s \n",i+1,s[i]);

}

Pig - Latin phrase from English language phrase ( Converting words into pig latin )

input : computer
output: omputercay ( omputer + c + ay )
-----------------------------------------------
input : jump
output: umpjay ( ump + j + ay )
-----------------------------------------------

//header file stdio.h
//header file string.h

main()

{
int i=0,wordcount=0;
char word[50];
char reorder[50];
char frst;

printf("enter the word : ");
gets(word);


frst = word[0];

for( i=0 ; word[i+1] != 0 ; i++)
{
reorder[i]=word[i+1];
}

reorder[i]=frst;
reorder[i+1]='a';
reorder[i+2]='y';
reorder[i+3]='\0';


printf("the pigLatin word is %s \n",reorder);


}