Write pseudo code for push in a stack?
Answers were Sorted based on User's Feedback
Answer / sanjeevkumar.v
push it mean INSERT the element to the STACK
Is This Answer Correct ? | 10 Yes | 14 No |
push means inserting an element on to the top of the stack.
lets define array of size 10,
int a[10]
Top<== -1 // stack is empty now.
Push(x)// x is a element to be push.lets take x=4
{
top<== top+1
// top will initialize to 1,now the top will be address to the 0 th index of array.//
a[Top]<== x
// insert x in to the 0th index of array(a[0]<== 4)//
}
Is This Answer Correct ? | 0 Yes | 4 No |
WHAT IS ABSTRUCT DATA TYPE ? PLEASE EXPLAIN IT.
Will I be able to get a picture in D drive to the c++ program? If so, help me out?
#include <string.h> #include <stdio.h> #include <stdlib.h> #include<conio.h> void insert(char *items, int count); int main(void) { char s[255]; printf("Enter a string:"); gets(s); insert(s, strlen(s)); printf("The sorted string is: %s.\n", s); getch(); return 0; } void insert(char *items, int count) { register int a, b; char t; for(a=1; a < count; ++a) { t = items[a]; for(b=a-1; (b >= 0) && (t < items[b]); b--) items[b+1] = items[b]; items[b+1] = t; } } design an algorithm for Insertion Sort
What does and I oop and sksksk mean?
What is encapsulation example?
#include <iostream> using namespace std; struct wow { int x; }; int main() { wow a; wow *b; a.x = 22; b = &a; a.x = 23; cout << b->x; return 0; }
How long to learn object oriented programming?
What is the highest level of cohesion?
What is static modifier?
what is function overloading..?
is there any choice in opting subjects like 4 out of 7
what are the characteristics of oops?