top button
Flag Notify
    Connect to us
      Site Registration

Site Registration

This func is true to push group member ?

–2 votes
336 views

void linkedstack::pushGroup(int a[], int size) {
for (int i=0; i<size; i++) {
nodetype *n=new nodetype;
n->info = a[i];
n=stacktop;
stacktop=stacktop->next ;

}
}

posted Dec 3, 2013 by As M Ob

Looking for an answer?  Promote on:
Facebook Share Button Twitter Share Button LinkedIn Share Button
What is the question...Please avoid spamming such a good site.
i want to  Modify the class linkedStackType by adding the following function to it:

void pushGroup(int a[], int size); // this will push a group of elements stored in the array a with size size into the linked stack.

NOTE: don’t call any function; you need to implement everything from scratch.
Where is the context, please make sure you do your research before asking the question. See people started negative voting on your question and once it reaches zero you will not able to ask questions.

Similar Questions
+7 votes

Given an array of random numbers, Push all the zero’s of a given array to the end of the array.

+1 vote

Considering a server that should ignore requests older than 1 second, create a structure to handle this behavior and give its complexity.

+2 votes

suppose we have an array of N natural numbers and asks him to solve the following queries:-
Query a:- modify the element present at index i to x.
Query b:- count the number of even numbers in range l to r inclusive.
Query c:- count the number of odd numbers in range l to r inclusive.

input:
First line of the input contains the number N. Next line contains N natural numbers.Next line contains an integer Q followed by Q queries.
a x y - modify the number at index x to y.
b x y - count the number of even numbers in range l to r inclusive.
c x y - count the number of odd numbers in range l to r inclusive.
I tried to solve using simple arrays but it isn't doing well for big constraints so I thought to use other DS with efficient algorithm so please explain appropriate algorithm.Thanks in advance.

...