can u tell y negative values are gettin printed? when recursive calls
return y is condition checking done again?
*Muthuraj R
IV th Year , ISE
PESIT , Bangalore*
On Wed, Aug 31, 2011 at 9:14 AM, Sanjay Rajpal srn...@gmail.com wrote:
Thank u swathi for making me clear about static variables.
@Dave: Explain your O(n3) solution please
*Muthuraj R
IV th Year , ISE
PESIT , Bangalore*
On Sat, Aug 27, 2011 at 11:10 PM, Mohit Goel mohitgoel291...@gmail.comwrote:
This code may also work .give any counter examples...
#includeiostream
using namespace std;
void find_sum(int
Can anyone explain logic of the above code ?
*Muthuraj R
IV th Year , ISE
PESIT , Bangalore*
On Sun, Aug 28, 2011 at 2:16 AM, Dheeraj Sharma dheerajsharma1...@gmail.com
wrote:
yeah..dat we all know..bt wat actually this code is doing..this is wat am
thinking!!!
On Sun, Aug 28, 2011 at
here is my approach.
flag=0;
void inorder(node *root , int value , node *predecessor)
{
if(root)
{
inorder(root-left,value , predecessor);
if(root-value!=value) // store the last node traversed as predessor
until you get the node we are searching
{
predecessor = root;
}
In Amazon written test Isomorphic trees were defined as those in which a
series of flips can transform one tree to another.
*Muthuraj R
IV th Year , ISE
PESIT , Bangalore*
On Sun, Aug 28, 2011 at 11:52 AM, bugaboo bharath.sri...@gmail.com wrote:
@Navneet,
What you are talking about are
No need to count the number of nodes. Since its implemented as a linked list
traverse the list with two two pointers one incremented one node next and
other incremented two nodes next simultaneously.
void delete_MiddleStack(node **h)
{
if(*h==NULL)
return;
node *p,*q;
p=*h;
u had read the question... it is simple.. push to new stack and
then pop back... number of elements count need to be there
On Mon, Aug 22, 2011 at 7:44 PM, muthu raj muthura...@gmail.com wrote:
No need to count the number of nodes. Since its implemented as a linked
list traverse the list
Segregate the Odd and even nodes in the list by traversing in O(n). Then
print the resulting list in O(n). So no additional space required and
solution in O(n) time also :)
*Muthuraj R
IV th Year , ISE
PESIT , Bangalore*
On Fri, Aug 19, 2011 at 9:48 AM, priya ramesh
Sorry The probability of machine being active is 1-0.212=0.788
*Muthuraj R
IV th Year , ISE
PESIT , Bangalore*
On Wed, Aug 17, 2011 at 5:10 PM, muthu raj muthura...@gmail.com wrote:
Even i got 0.212
*Muthuraj R
IV th Year , ISE
PESIT , Bangalore*
On Wed, Aug 17, 2011 at 4:42 PM
Even i got 0.212
*Muthuraj R
IV th Year , ISE
PESIT , Bangalore*
On Wed, Aug 17, 2011 at 4:42 PM, Romil ... vamosro...@gmail.com wrote:
Kumar's approach would not do perhaps. I simply eliminated the undesired
cases. Those include the one when none of them is active and when only one
The problem is because of \n in the prnintf statement. When new line is
there in first printf it flushes the standard buffer and so in child the
output of printf is not present in second program.
*Muthuraj R
IV th Year , ISE
PESIT , Bangalore*
On Sat, Aug 13, 2011 at 9:29 PM, Ankur Khurana
What is the difference between the following statements.
int a=1,2,3 ;
and
int a;
a=1,2,3;
first one is an error while second one is not.
Can Any one tell me y ?
*Muthuraj R
IV th Year , ISE
PESIT , Bangalore*
--
You received this message because you are subscribed to the Google
@coder dumca: If u apply DFS u will get a brother and not cousin. And yes
it works only for some cases.
*Muthuraj R
IV th Year , ISE
PESIT , Bangalore*
On Wed, Aug 10, 2011 at 2:24 PM, coder dumca coder.du...@gmail.com wrote:
apply BFS
the node after the particular node(whode cousin to be
at 3:26 PM, muthu raj muthura...@gmail.com wrote:
@coder dumca: If u apply DFS u will get a brother and not cousin. And yes
it works only for some cases.
*Muthuraj R
IV th Year , ISE
PESIT , Bangalore*
On Wed, Aug 10, 2011 at 2:24 PM, coder dumca coder.du...@gmail.comwrote:
apply BFS
Write a C code to find Leftmost right cousin at the same level.
For ex:
10
/\
2 3
/\ /\
8 56 9
Leftmost right cousin of 5 is 6. Leftmost right cousin of 3 is NULL
*Muthuraj R
IV th Year , ISE
PESIT , Bangalore*
--
You received this message because you are subscribed to the
pls explain how u got 27?
*Muthuraj R
IV th Year , ISE
PESIT , Bangalore*
On Wed, Aug 10, 2011 at 1:13 AM, sagar pareek sagarpar...@gmail.com wrote:
in ques 1 i considered leaves as nodes... if we consider only internal
nodes then it have 27
On Wed, Aug 10, 2011 at 1:12 AM, sagar pareek
Microsoft written:
What is the probability of getting atleast one 6 in 3 attempts of a dice?
*Muthuraj R
IV th Year , ISE
PESIT , Bangalore*
On Sat, Aug 6, 2011 at 7:34 AM, shady sinv...@gmail.com wrote:
Hi,
A fair dice is rolled. Each time the value is noted and running sum is
physical adress is never acessible.Those who claim physical adress pls
support ur answers.
*Muthuraj R
IV th Year , ISE
PESIT , Bangalore*
On Fri, Aug 5, 2011 at 4:57 PM, Kamakshii Aggarwal kamakshi...@gmail.comwrote:
logical address
On Fri, Aug 5, 2011 at 2:20 PM, Amol Sharma
Yeah Kadanes algorithm. It can be done in O(n);
*Muthuraj R
IV th Year , ISE
PESIT , Bangalore*
On Fri, Aug 5, 2011 at 6:49 PM, Naren s sweetna...@gmail.com wrote:
http://people.csail.mit.edu/bdean/6.046/dp/
--
You received this message because you are subscribed to the Google Groups
Can any one explain the working of %[A telephonnic girl]
*Muthuraj R
IV th Year , ISE
PESIT , Bangalore*
On Thu, Aug 4, 2011 at 12:25 PM, Nitish Garg nitishgarg1...@gmail.comwrote:
The input for the above code was hello world. So the output would be hello.
As the input will stop on reading
@poised: Since it is read only memory junk will be the output if and only if
we enter any string containing characters not inside []. If we try
entering something present within [] i am getting segmentation fault.
*Muthuraj R
IV th Year , ISE
PESIT , Bangalore*
On Thu, Aug 4, 2011 at
, muthu raj muthura...@gmail.com wrote:
1) subjective question:
To find the first repetitive character how can you use bits because you
cannot keep track of first repeated character and also if a character is
present more than twice for ex thrice its mask shows 1 indicating it has
occured once
Malloc implementation isnt simple as above. It involves system call sbrk()
to request memory to operating system and a suitable data structure to
allocate and deallocate memory from available memory blocks. Proper
implementation of malloc is given in Kerningha ritchie text book :)
*Muthuraj R
IV
5)
Sample space=24C2= 276
N(S) = 12 C 2 + 12 C 2 =132
Probability= 132/276= 11/23
*Muthuraj R
IV th Year , ISE
PESIT , Bangalore*
On Wed, Aug 3, 2011 at 10:36 PM, Prakash D cegprak...@gmail.com wrote:
assume there are 6 1's and 6 0's
if two are selected together randomly%
the possible
1) subjective question:
To find the first repetitive character how can you use bits because you
cannot keep track of first repeated character and also if a character is
present more than twice for ex thrice its mask shows 1 indicating it has
occured once. So please tell how to implement in O(1)
Use a circular linked list with elements being inserted in sorted order.
Inserting minimum element :
struct node *p;
p is a pointer to last node in the circular singly linked list.
newmin-next=p-next;
p-next=newmin;
Deleting minimum element:
struct node *temp;
temp=p-next;
p-next=p-next-next;
By declaring the function a static final f().
*Muthuraj R
IV th Year , ISE
PESIT , Bangalore*
On Sun, Jul 31, 2011 at 7:28 AM, himanshu kansal
himanshukansal...@gmail.com wrote:
sry i thinki misspelled d ques
d ques was
how will you protect a derived class to override
being overridden.
*Muthuraj R
IV th Year , ISE
PESIT , Bangalore*
On Sun, Jul 31, 2011 at 7:38 AM, himanshu kansal
himanshukansal...@gmail.com wrote:
i think there is no keyword known as final in c++.maybe u are talking
with respect to java
On Sun, Jul 31, 2011 at 8:03 PM, muthu raj
On Sun, Jul 31, 2011 at 8:03 PM, muthu raj muthura...@gmail.com wrote:
By declaring the function a static final f().
*Muthuraj R
IV th Year , ISE
PESIT , Bangalore*
On Sun, Jul 31, 2011 at 7:28 AM, himanshu kansal
himanshukansal...@gmail.com wrote:
sry i thinki misspelled d ques
;
}
};
int main()
{
B ob;
ob.f();
return 0;
}
in this output is abc..
so overriding occured
On Sun, Jul 31, 2011 at 8:41 PM, muthu raj muthura...@gmail.comwrote:
Using friend functions we can only invoke already defined private
functions. We cannot override or prevent
Please elaborate upon the question a little more :)
*Muthuraj R.
4TH Year BE.**
Information Science Dept*
*PESIT, Bengaluru .
*
On Thu, Jul 28, 2011 at 4:21 PM, KK kunalkapadi...@gmail.com wrote:
bool foo(int x)
// Implement this function where 0 = x = 100
It should return true x% of
Thnks a lot neha :)
*Muthuraj R.
4TH Year BE.**
Information Science Dept*
*PESIT, Bengaluru .
*
On Thu, Jul 28, 2011 at 6:01 PM, Neha Sharan neharick...@gmail.com wrote:
@rahul:what kind of questons were asked in aptitude test?
On Thu, Jul 28, 2011 at 5:54 PM, Rahul Menon
ya me toowas readin % as modulus :)
*Muthuraj R.
4TH Year BE.**
Information Science Dept*
*PESIT, Bengaluru .
*
On Thu, Jul 28, 2011 at 9:13 PM, sunny agrawal sunny816.i...@gmail.comwrote:
Okay... i was reading % as Modulus operator :(
did u gave the solution Nikhil posted , i think
I am getting the proper output :) 1 0 1 0 1 1 0 1
*Muthuraj R.
4TH Year BE.**
Information Science Dept*
*PESIT, Bengaluru .
*
On Wed, Jul 27, 2011 at 11:19 PM, Vijay Khandar vijaykhand...@gmail.comwrote:
#includestdio.h
#includeconio.h
int f(int n)
{
if(n=1)
{
printf( %d,n);
}
34 matches
Mail list logo