Re: [algogeeks] LEFT MOST set bit in an unsigned integer.

2012-06-14 Thread aditya kumar
for 16bit ..take a number n = 1000 let x be the number mentionf in a question pos = -1 while (1){ if(x & n){ pos++ exit} else n »=1 } pos is the answer if pos is greater than numbr of bits then x doesnt hv set bits > How to find the LEFT MOST set bit in an unsigned integer. > Example

Re: [algogeeks] Amazon Interview Question

2012-01-19 Thread ADITYA KUMAR
> > > > > > -- > > > **Regards > * > * > > Bharat B | M.Tech II | Computer Science & Engineering | IITM > * > * > *Ph: +91 8056127652* > > -- > You received this message because you are subscribed to the Google Groups > "Algor

Re: [algogeeks] Re: sqrt function...

2012-01-06 Thread ADITYA KUMAR
from this group, send email to > algogeeks+unsubscr...@googlegroups.com. > For more options, visit this group at > http://groups.google.com/group/algogeeks?hl=en. > -- Regards Aditya Kumar B-tech IV year Computer Science & Engg. MNNIT, Allahabad. -- You received this message

Re: [algogeeks] what will be the focus of yahoo in written exam ,what to study for it. please respond ASAP..

2011-11-14 Thread aditya kumar
guys this is not the ideal place to discuss placement related questions . plz query in interviewstreet group On Mon, Nov 14, 2011 at 5:24 PM, wujin chen wrote: > two month ago , I passed yahoo written test in china. > data structure, algorithm , and given a code segment with some lines > miss

[algogeeks] Post only ALGO RELATED QUESTIONS ...

2011-10-06 Thread aditya kumar
do justify the name of the group .. thnks -- You received this message because you are subscribed to the Google Groups "Algorithm Geeks" group. To post to this group, send email to algogeeks@googlegroups.com. To unsubscribe from this group, send email to algogeeks+unsubscr...@googlegroups.com.

Re: [algogeeks] Re: Help sourcebit !!!

2011-10-06 Thread aditya kumar
guys its my sincere request to all .. before posting any question plz plz do search for archives first . if you would had done that you could have got better knowledge . On Wed, Oct 5, 2011 at 9:14 PM, raman shukla wrote: > Hey mate dont worry there is nothing like pattern, You should be able >

Re: [algogeeks] Re: EMC^2

2011-10-01 Thread aditya kumar
package is 8.75 l that has 7.5l as fst mothn bonus . so ctc is 8l On Sun, Oct 2, 2011 at 2:10 AM, Sahil Garg wrote: > how much package?? > > Sahil Garg > Computer Engineering > Delhi College of Engineering > > > > On Sun, Sep 25, 2011 at 1:32 AM, aditya kumar <

[algogeeks] SOURCEBITS :: EXPERIENCE

2011-09-30 Thread aditya kumar
1st round was a written test . It had 30 mcq's . This was the easiest mcq's . 20 simple aptitude questions were thr along with some 10 C questions . 21 students were shortlisted for the first round . in the interview round they asked me basics questions possibly from all the subjects . 1) deadlock

Re: [algogeeks] Re: Yahoo

2011-09-29 Thread aditya kumar
cords seprated by new line >> > > (records can be repeat) >> > > and a substring given for eg"abc" >> > >> > > now check for the record which contains the substring >> > > and print top 10 record according to their frequency >>

[algogeeks] INTEL recruitment process

2011-09-29 Thread aditya kumar
Guys does any one hve the idea about INTEL interview process for CS students ?? The area they focus and types of question they ask . If any have any idea plz help ! thnks -- You received this message because you are subscribed to the Google Groups "Algorithm Geeks" group. To post to this group,

Re: [algogeeks] Source Bits

2011-09-27 Thread aditya kumar
rajeev hw much did they offer u ? On Tue, Sep 27, 2011 at 5:55 PM, rajeev bharshetty wrote: > Technical Interview : > >- Tell me about yourself ? > > > > I emphasized more on my OpenSource projects and the Contribution > to Amarok ( Video Player Project ). I even stressed on

Re: [algogeeks] without using '-'

2011-09-26 Thread aditya kumar
+1 to abhishek On Mon, Sep 26, 2011 at 11:44 PM, Abhishek Gupta wrote: > thats basically taking twos' compliment and converting it to negative one > and then adding it..its the same principle...which is used for dividing two > numbers without using '/' and '-'...right kunal?? > > > On Mon, Sep 26

Re: [algogeeks] without using '-'

2011-09-26 Thread aditya kumar
find the smallest of two number . then keep adding 1 to the smaller number till you get the bigger number . this will give you absolute diff so check for the correct ans . in case you have floating number then add unit of fraction . and repeat the same . On Mon, Sep 26, 2011 at 7:33 PM, ~*~VICKY~*~

Re: [algogeeks] Sourcebits [wrriten n interview round]

2011-09-26 Thread aditya kumar
5.5 lakhs On Mon, Sep 26, 2011 at 1:46 PM, Aditya Virmani wrote: > what package did they offer? > > On Mon, Sep 26, 2011 at 9:41 AM, aditya kumar < > aditya.kumar130...@gmail.com> wrote: > >> 1st round was a written test . It had 30 mcq's . This was the easiest

Re: [algogeeks] Sourcebits [wrriten n interview round]

2011-09-25 Thread aditya kumar
1st round was a written test . It had 30 mcq's . This was the easiest mcq's . 20 simple aptitude questions were thr along with some 10 C questions . 21 students were shortlisted for the first round . in the interview round they asked me basics questions possibly from all the subjects . 1) deadlock

Re: [algogeeks] Yahoo

2011-09-25 Thread aditya kumar
I cleared the written round, the next round was coding round. We were asked to select any one problem out of three in 2 hrs. Q1) Given n number of xml files find a particular word and output should list all the files in current directory that contains that word. Q2) Given a hierarichal structure

Re: [algogeeks] Source Bits

2011-09-24 Thread aditya kumar
ya same pattern was in PESIT college . but be careful in mcq's 26/30 was cutt off .. it was easy n ya thr was no negative marking . in objective they had more stress on number system . i got selected in Sourcebits :) On Sun, Sep 25, 2011 at 11:14 AM, aanchal goyal wrote: > thanks a lot rajeev :)

Re: [algogeeks] os ques about paging

2011-09-24 Thread aditya kumar
m sry i dint read the question properly page no = vitual page % 3 ie 0 % 3 = 3 thrfre 3*1024 is starting addr of physical page but the byte address will be 3*1024 + 512 = 3584 On Sun, Sep 25, 2011 at 10:12 AM, Vishnu Ganth wrote: > 3584 > > > On Sun, Sep 25, 2011 at 9:53 AM, sivaviknesh s wrote:

Re: [algogeeks] os ques about paging

2011-09-24 Thread aditya kumar
c) 512 On Sun, Sep 25, 2011 at 9:53 AM, sivaviknesh s wrote: > > > > Consider a virtual memory system in which the virtual page addresses are > mapped onto physical page addresses as follow > Virtual page address.. Physical page address > 0.

Re: [algogeeks] Re: EMC^2

2011-09-24 Thread aditya kumar
U will be recruited :) :) > > Some details about the company: > > Basically a storage management company > Core work: RAID groups, storage solutions for other clients. > Also working on virtualization (virtual servers) and now moving > towards cloud computing > > > AL

[algogeeks] EMC^2

2011-09-24 Thread aditya kumar
does any one have the idea about emc2 .?? if yes plz do share the details -- You received this message because you are subscribed to the Google Groups "Algorithm Geeks" group. To post to this group, send email to algogeeks@googlegroups.com. To unsubscribe from this group, send email to algogeek

Re: [algogeeks] Flip kart

2011-09-23 Thread aditya kumar
t;> >> >> On Fri, Sep 23, 2011 at 1:54 AM, aditya kumar < >> aditya.kumar130...@gmail.com> wrote: >> >>> those three question they ASKD me in interview nt in coding round n they >>> are very particular abt coding >>> >>> >>>

Re: [algogeeks] Flip kart

2011-09-22 Thread aditya kumar
those three question they ASKD me in interview nt in coding round n they are very particular abt coding On Fri, Sep 23, 2011 at 1:53 AM, aditya kumar wrote: > 11.5 fr our college > they will hve online test .. 3 coding question and u need to attempnt any > two ..25mcq's .. mcq;s

Re: [algogeeks] Flip kart

2011-09-22 Thread aditya kumar
11.5 fr our college they will hve online test .. 3 coding question and u need to attempnt any two ..25mcq's .. mcq;s wer mostly frm sql .. Q-> Given a linked list find whether the linked list is palindrome or not. I gave him solution by modifying the linked list then i gave solution using extra spa

Re: [algogeeks] Re: matrix

2011-09-17 Thread aditya kumar
@prasanth : sinjalspecial is correct bt his code works for 1D array . for 2D array you can think of array of 1D array and then implement the same . newazz here is one link : http://tech-queries.blogspot.com/2010/05/find-max-sum-in-2d-array.html On Sat, Sep 17, 2011 at 8:43 PM, tech coder wrote: >

[algogeeks] External Sort : source code or any link ??

2011-09-17 Thread aditya kumar
External Sort : source code or any link ?? -- You received this message because you are subscribed to the Google Groups "Algorithm Geeks" group. To post to this group, send email to algogeeks@googlegroups.com. To unsubscribe from this group, send email to algogeeks+unsubscr...@googlegroups.com.

Re: [algogeeks] Directi Questions - needed answers

2011-09-17 Thread aditya kumar
comparisons between > 2 numbers... > > > On Sat, Sep 17, 2011 at 5:04 PM, aditya kumar < > aditya.kumar130...@gmail.com> wrote: > >> @yogesh: we can get second max by comparing n elements ie O(n). >> >> >> On Sat, Sep 17, 2011 at 4:59 PM, Ashima .

Re: [algogeeks] matrix

2011-09-17 Thread aditya kumar
i guess kadane's algo doesnt tell u abt the subarray element instead it tells abt max sum of subarray . to get the element of subarray store the end_offset whenever your max_sum changes . On Sat, Sep 17, 2011 at 4:47 PM, sukran dhawan wrote: > kadane s algo > > > On Sat, Sep 17, 2011 at 3:25 PM,

Re: [algogeeks] Directi Questions - needed answers

2011-09-17 Thread aditya kumar
@yogesh: we can get second max by comparing n elements ie O(n). On Sat, Sep 17, 2011 at 4:59 PM, Ashima . wrote: > ans 8: > it should be 40% > @dheeraj: if total is 100 percent and other person paid more than 1st > person.Than how can the 1st person's percentage be more than 50%? > > Ashima > M.

[algogeeks]

2011-09-09 Thread aditya kumar
Given k sorted streams where each stream could possibly be infinite in length, describe an efficient algorithm to merge the k streams into a new stream (also in sorted order). -- You received this message because you are subscribed to the Google Groups "Algorithm Geeks" group. To post to this gr

Re: [algogeeks] Min no of moves

2011-09-05 Thread aditya kumar
we need n/2 swaps On Mon, Sep 5, 2011 at 2:34 PM, sachin goyal wrote: > it means we r considring d value for 2*n...so need total n passes... > > On Mon, Sep 5, 2011 at 1:33 PM, aditya kumar > wrote: > >> @dheeraj : u are right . i dint read the question properly . i th

Re: [algogeeks] Min no of moves

2011-09-05 Thread aditya kumar
TO MY UNDERSTANDING WE CAN DIRECTLY REPLACE THE 2ND WITH SECOND >>> AND 4TH WITH 4TH >>> TELL CORRECT ME IF I AM WRONG AND I AM TRATING WRONG??????? >>> >>> >>> >>> On Sun, Sep 4, 2011 at 8:04 PM, *$* wrote: >>> >>>> yes n/4 swap

Re: [algogeeks] Re: Network Question

2011-09-04 Thread aditya kumar
/24 can communicate with 10.0.1.0/26 >>>> > but cannot communicate within itself .. >>>> > >>>> > On Sep 3, 9:38 am, bharatkumar bagana >>>> > wrote: >>>> > >>>> > >>>> > >>>> > >

[algogeeks]

2011-09-04 Thread aditya kumar
How to find longest common substring in two strings ? i want efficent code and iff possible any method other than using suffix tree . -- You received this message because you are subscribed to the Google Groups "Algorithm Geeks" group. To post to this group, send email to algogeeks@googlegroups.

Re: [algogeeks] Padding....

2011-09-04 Thread aditya kumar
padding related questions have been discussed many times . plz search. On Sun, Sep 4, 2011 at 4:13 PM, bharatkumar bagana < bagana.bharatku...@gmail.com> wrote: > struct data > { > char a; > int b; > }__attribute__((packed)); > This is way to get the actual size of struct without any padding > ht

Re: [algogeeks] Please provide Code to Find kth Smallest or kth Largest element in unsorted array in liner time ?

2011-09-04 Thread aditya kumar
first do quick sort . ie (nlog n) then find kth largest/smallest . On Sun, Sep 4, 2011 at 6:28 PM, learner wrote: > something I Know using quick sort randomization function we can find > kt smallest/largest in unsorted array , but i am not able to write > code , please help me in this and provid

Re: [algogeeks] Min no of moves

2011-09-04 Thread aditya kumar
swap n/2-1 with n/2+1 , and then n/2-3 with n/2+3 till we reach n-1 . so we need n/4 swaps . On Sun, Sep 4, 2011 at 5:28 PM, Anup Ghatage wrote: > That's interesting. > > when n = 3 > > We have been given this :F F F | E E E > > Swap the middle element and it becomes: F E F | E F E > > Which is

Re: [algogeeks] Tejas networks

2011-09-04 Thread aditya kumar
q4) floyds algorithm for shortest path . On Sun, Sep 4, 2011 at 5:41 PM, sukran dhawan wrote: > for q3 :either both inorder and preorder traversal shud be stored or > inorder and postorder shud be stored > > > On Sun, Sep 4, 2011 at 2:54 PM, sukran dhawan wrote: > >> >> >> -- Forwarded me

Re: [algogeeks] Network Question

2011-09-02 Thread aditya kumar
their wont be any conflict in ip address . coz within dhcp assigns ip adsress from the pool of available address and within the n/w (LAN) we need to have unique ip address bt across the n/w (LAN) we can use same ip from the pool of ip addresses . On Sat, Sep 3, 2011 at 1:56 AM, sagar pareek wrot

Re: [algogeeks] akamai

2011-09-02 Thread aditya kumar
haha ya i missd one zero its rs 1008000 ctc On Fri, Sep 2, 2011 at 6:09 PM, sukran dhawan wrote: > i think u missed a zero :) > > > On Fri, Sep 2, 2011 at 5:49 PM, aditya kumar > wrote: > >> Rs 100800 // this is CTC >> basic pay is around 7lakhs >> >>

Re: [algogeeks] akamai

2011-09-02 Thread aditya kumar
Rs 100800 // this is CTC basic pay is around 7lakhs On Fri, Sep 2, 2011 at 1:15 PM, sukran dhawan wrote: > how much they pay ? > > On Fri, Sep 2, 2011 at 11:24 AM, aditya kumar < > aditya.kumar130...@gmail.com> wrote: > >> they basically ask questions on DBMS and netwo

Re: [algogeeks] akamai

2011-09-02 Thread aditya kumar
first round had two sections 1)aptitude and technical 2)coding then follows two rounds of technical interview and one round of hr On Fri, Sep 2, 2011 at 11:33 AM, somya mishra wrote: > thanx man only 2 rounds were there? > > > On Fri, Sep 2, 2011 at 11:24 AM, aditya kumar < &g

Re: [algogeeks] Re: Data Structure Question

2011-09-01 Thread aditya kumar
@saloni : its LIFO nt FIFO On Fri, Sep 2, 2011 at 11:24 AM, sharmila saru wrote: > stack bcoz push & pop in FIFO manner > > -- > You received this message because you are subscribed to the Google Groups > "Algorithm Geeks" group. > To view this discussion on the web visit > https://groups.google

Re: [algogeeks] Find the Max from each sub-array of size k

2011-09-01 Thread aditya kumar
how did u get such o/p for k=4 ?? i dint get plz expalin On Fri, Sep 2, 2011 at 9:04 AM, Anup Ghatage wrote: > Given an unsorted Array A and any integer k where k <= size of A > > Print the maximum of each sub-array of size k of A. > > eg: A = [ 3, 5, 1, 9, 0, 4, -1, 7 ] k = 4 > Max: 9 9

Re: [algogeeks] Static variable memory location

2011-09-01 Thread aditya kumar
static variables are allocated on heap . and global variables are sored on data segment On Fri, Sep 2, 2011 at 9:30 AM, rahul sharma wrote: > static variable is stored in data segement so it is alive thorugh the > proggo through let us c : data types > > > On Wed, Aug 31, 2011 at 10:16 PM, Sw

Re: [algogeeks] akamai

2011-09-01 Thread aditya kumar
they basically ask questions on DBMS and networking. In DBMS fst round mainly had SQL and 1 coding question related to ER DIAGRAM . in written round 3 question ws thr 1)ER diagram 2)stack n que 3)print this pattrn for n=3 X***X *X*X* **X***X** ***X*X*** X ***X*X*** **X***X** *X*

Re: [algogeeks] Data Structure Question

2011-09-01 Thread aditya kumar
stack coz of the lifo nature . i guess so On Fri, Sep 2, 2011 at 11:08 AM, Mani Bharathi wrote: > @kb2029: how? why? > > -- > You received this message because you are subscribed to the Google Groups > "Algorithm Geeks" group. > To view this discussion on the web visit > https://groups.google.co

Re: [algogeeks] Re: Static variable

2011-08-31 Thread aditya kumar
: > no it will pus like > printf("d",i) > > . > . > . > .. > so onm > > > but i is static > latest value used > 9 > 8 > 7 > instred of these printf are pushed > > On Aug 31, 7:53 pm, aditya kumar wrote: > > @rahul : wen the

Re: [algogeeks] Re: Static variable

2011-08-31 Thread aditya kumar
@rahul : wen the values are pushed on to the stack they are like 9 , 8 , 7 , till 0 so when they pop out shouldnt it be follwing the order 0 1 2 till 9 . i realy dont know why the o/p is 0 -1 -2 and so on ?? On Wed, Aug 31, 2011 at 8:18 PM, rahul sharma wrote: > i thnink it works as follow:- > >

Re: [algogeeks] Amazon - Coding Round-2 Qn

2011-08-31 Thread aditya kumar
@rohit : else return (check(tree->left) || check(tree->right)); should be else return (check(tree->left) && check(tree->right)); we need both the left and the right to be true . On Wed, Aug 31, 2011 at 4:18 PM, rohit wrote: > Q1. > > NODE* head //points to the bst(if it exists) > > v

Re: [algogeeks] Re: Find square root a number

2011-08-30 Thread aditya kumar
let u have to find the square root of s . a=sqrt(s) ; a^2=s ; 2(a^a)=s+a^2 ; a=(s+a^2)/2a ; after 20th iteration you will get more approximated value . hopefully it will help .:) On Tue, Aug 30, 2011 at 9:14 PM, teja bala wrote: > @aditya kumar > Will u plz explain the logic involve

Re: [algogeeks] Re: Find square root a number

2011-08-30 Thread aditya kumar
void getSquareRoot(float s) { float a=s; int i=0; for(i=0;i<20;i++) { a=(s+a*a)/(2*a); } printf("square root is %f",a); } On Tue, Aug 30, 2011 at 6:00 PM, Sanjay Rajpal wrote: > Binary Search kind of mathod is useful here : > > float SquareRoot(float n,float start,float end) > { > fl

[algogeeks] Is This algorithm gives right answer ?? // algo to find max subarray ie whose sum is max

2011-08-29 Thread aditya kumar
Kadane's Algorithm(array[1..n]) begin (maxSum, maxStartIndex, maxEndIndex) := (-INFINITY, 0, 0) currentMaxSum := 0 currentStartIndex := 1 for currentEndIndex := 1 to n do currentMaxSum := currentMaxSum + array[currentEndIndex] if currentMaxSum > maxSum then

Re: [algogeeks] Re: c program

2011-08-28 Thread aditya kumar
e good old > spirit of a challenge (not merely for an interview) So the best way remains > the store everything way... > > On Sun, Aug 28, 2011 at 3:11 PM, aditya kumar < > aditya.kumar130...@gmail.com> wrote: > >> one more method : use system funtion . >>

Re: [algogeeks] Re: c program

2011-08-28 Thread aditya kumar
one more method : use system funtion . eg system("cat filename") //system funtion executes the command On Sun, Aug 28, 2011 at 1:51 PM, UTKARSH SRIVASTAV wrote: > good logic > > > On Sun, Aug 28, 2011 at 12:14 AM, Piyush Grover > wrote: > >> yeah you can do that by opening the file and printing

Re: [algogeeks] Re: microsoft

2011-08-27 Thread aditya kumar
My friend has shared his experience in this doc . He got selected . hope it will help u guys as well !! On Sat, Aug 27, 2011 at 12:12 PM, siva viknesh wrote: > hi search this group.. u ll get lot of interview ques recently > attended for ms > > On Aug 27, 10:58 am, rahul sharma wrote: > > i joi

Re: [algogeeks] reverse

2011-08-24 Thread aditya kumar
does anyone know the correct solution this problem ?? problem : i/p :: 39 o/p:: 93 (using bitwise operator) On Fri, Aug 12, 2011 at 1:41 PM, Prakash D wrote: > how does the above code work? > > > On Fri, Aug 12, 2011 at 1:14 PM, Rahul wrote: > >> I understand. where I find some more tricks like

Re: [algogeeks] Multiprocessor scheduling

2011-08-23 Thread aditya kumar
what are the arrival time ?? On Tue, Aug 23, 2011 at 8:19 PM, saurabh singh wrote: > Given m jobs and p processors find the *most optimal scheduling.* > Is this problem NP complete like subset problem? > I am trying on a greedy solution but most of them are failing > > -- > Saurabh Singh > B

Re: [algogeeks] Compute a+bx2+cx3+dx4+... efficiently (a,b,c...given)

2011-08-22 Thread aditya kumar
(x(x(b+x(c+dx On Tue, Aug 23, 2011 at 10:21 AM, saurabh agrawal wrote: > Compute a+bx2+cx3+dx4+... efficiently (a,b,c...given) > > -- > You received this message because you are subscribed to the Google Groups > "Algorithm Geeks" group. > To post to this group, send email to algogeeks@googleg

Re: [algogeeks] AMAZON

2011-08-21 Thread aditya kumar
> On Sat, Aug 20, 2011 at 4:25 PM, aditya kumar < > aditya.kumar130...@gmail.com> wrote: > >> PESIT >> >> >> On Sat, Aug 20, 2011 at 4:23 PM, Sanjay Rajpal wrote: >> >>> which college ? >>> >>> >>> Sanju >>>

Re: [algogeeks] Re: Amazon question

2011-08-20 Thread aditya kumar
instead of that find sum of first n natural number sum ie (n(n+1))/2.;say NSum then find the sum of all elements of the array . say ASum ASUm - NSum = result (no repeated twice). On Fri, Aug 19, 2011 at 7:30 PM, Sanjay Rajpal wrote: > :) > > > *Regards > > Sanju > > Happy to Help :)* > > > > --

Re: [algogeeks] AMAZON

2011-08-20 Thread aditya kumar
PESIT On Sat, Aug 20, 2011 at 4:23 PM, Sanjay Rajpal wrote: > which college ? > > > Sanju > :) > > > -- > You received this message because you are subscribed to the Google Groups > "Algorithm Geeks" group. > To post to this group, send email to algogeeks@googlegroups.com. > To unsubscribe from

[algogeeks] AMAZON

2011-08-20 Thread aditya kumar
heyy which subjects need to be studied more for AMAZON .?? AMAZON visiting our campus 22nd aug . -- You received this message because you are subscribed to the Google Groups "Algorithm Geeks" group. To post to this group, send email to algogeeks@googlegroups.com. To unsubscribe from this group,

Re: [algogeeks] Question from Google interview

2011-08-18 Thread aditya kumar
not sure abt the algo but we can think in terms of tokeninzing . ie go for greedy method . greedy looks for maximum match . extract the token and match with the dictionary word . if match found then add the additional space else look for next token . On Thu, Aug 18, 2011 at 9:10 PM, Navneet Gupta w

Re: [algogeeks] Re: calculate a/b without using ‘*’, ‘/’’ and ‘%’

2011-08-18 Thread aditya kumar
how abt subtracting . like a=a-b till a becomes zero . no of times subtraction is done is the answer . correct me if i am wrong ! On Thu, Aug 18, 2011 at 8:59 PM, Dave wrote: > @Radha: You could simulate long division. It would look something like > this: > > int divide(int a, int b) > { >in

Re: [algogeeks] apti! solve this!

2011-08-17 Thread aditya kumar
answer has to be sqrt(146) . 13 cant be the answer On Wed, Aug 17, 2011 at 7:55 PM, priya ramesh < love.for.programm...@gmail.com> wrote: > the answer is given as 13... even i got root(146) > > -- > You received this message because you are subscribed to the Google Groups > "Algorithm Geeks" gro

Re: [algogeeks] Re: matrix question ???!!!!!!!!!!??????????

2011-08-17 Thread aditya kumar
@dave : +1 On Wed, Aug 17, 2011 at 4:05 PM, Dave wrote: > @Anika: You don't have to find the max and min elements of the entire > array to find a row that doesn't contain either of them. If you scan 3 > rows, you will find a row that contains the max of those three rows, > another that contains t

Re: [algogeeks] De shaw ques!

2011-08-17 Thread aditya kumar
i guess if the option is provided it would have been an appropiate question . On Wed, Aug 17, 2011 at 6:02 PM, Rohit Srivastava wrote: > +1 to nitin > > > On Wed, Aug 17, 2011 at 6:02 PM, Romil ... wrote: > >> People this is not the way to approach this one. This question seems to be >> unfai

Re: [algogeeks] De shaw ques!

2011-08-17 Thread aditya kumar
@priya . i have shown you my method . write your method and we shall discuss it . On Wed, Aug 17, 2011 at 5:52 PM, sukran dhawan wrote: > > > On Wed, Aug 17, 2011 at 5:39 PM, priya ramesh < > love.for.programm...@gmail.com> wrote: > >> if a number is divided by 935 remainder is 69. if same no. is

Re: [algogeeks] probability tough one!

2011-08-17 Thread aditya kumar
no of days in a year shud be 365 or 366 ?? On Wed, Aug 17, 2011 at 5:49 PM, priya ramesh < love.for.programm...@gmail.com> wrote: > what is the probability of having b'days of 2 persons on the same day in a > gathering of 50 persons? > > -- > You received this message because you are subscribed t

Re: [algogeeks] De shaw ques!

2011-08-17 Thread aditya kumar
let the number be 935+69 = 1004 (bcoz divide 1004%935 = 69 ) now 1004 % 38 = 16 ANS On Wed, Aug 17, 2011 at 5:39 PM, priya ramesh < love.for.programm...@gmail.com> wrote: > if a number is divided by 935 remainder is 69. if same no. is divided by > 38, what will be the remainder? > > -- > You rece

Re: [algogeeks] GS apti ques!

2011-08-17 Thread aditya kumar
take four cases : 1) A success B success C failure 2) A success B failure C success 3) A failure B success C success 4) A , B , C = success add all the four cases :) On Wed, Aug 17, 2011 at 5:23 PM, priya ramesh < love.for.programm...@gmail.com> wrote: > A mistake from my side as well! > Got 78.

Re: [algogeeks] matrix question ???!!!!!!!!!!??????????

2011-08-14 Thread aditya kumar
arg wrote: >> >>> some how im not able to get the logic...how will i be able to find max >>> and min of the entire matrix by jst traversing 3 rows?? >>> >>> for eg >>> 1 2 3 4 5 >>> 8 1 3 6 9 >>> 4 6 3 2 10 >>> 9 0

Re: [algogeeks] matrix question ???!!!!!!!!!!??????????

2011-08-14 Thread aditya kumar
just traverse the three rows and get the max and min out of the three rows . print the row in which their is no max and min . On Mon, Aug 15, 2011 at 1:02 AM, aditya kumar wrote: > yes > > > On Mon, Aug 15, 2011 at 12:58 AM, aditi garg wrote: > >> @shady : does O(3n) include

Re: [algogeeks] matrix question ???!!!!!!!!!!??????????

2011-08-14 Thread aditya kumar
gt; On Mon, Aug 15, 2011 at 12:45 AM, Amir Aavani wrote: >> >>> >>> On 08/14/2011 11:46 AM, aditya kumar wrote: >>> >>>> it can be done in O(3n). in worst case one row will have max and anothr >>>> row >>>> will have min so the thir

Re: [algogeeks] array ques

2011-08-14 Thread aditya kumar
@aditi : sry i dint realise that n > log n .:P On Mon, Aug 15, 2011 at 12:38 AM, aditi garg wrote: > @aditya : dis is obviously correct bt here complexity will be O(n) bt we > are asked to gv O(log n) solution > > On Mon, Aug 15, 2011 at 12:37 AM, aditya kumar < > aditya.

Re: [algogeeks] array ques

2011-08-14 Thread aditya kumar
for(j=0;jwrote: > just my 2 cents in d binary search, replacing key with mid, ie > if(a[mid] > mid) > check lower half > else upper half > > should work?? > > > On Mon, Aug 15, 2011 at 12:26 AM, aditi garg wrote: > >> Given an ordered array A[1…n] with numbers in strictly increasing >> order.

Re: [algogeeks] matrix question ???!!!!!!!!!!??????????

2011-08-14 Thread aditya kumar
it can be done in O(3n). in worst case one row will have max and anothr row will have min so the third row will be your o/p to print On Mon, Aug 15, 2011 at 12:00 AM, Karthikeyan palani < karthikeyan...@gmail.com> wrote: > sorry O(n^2) s the time complexity > > > On 14 August 2011 23:56, shady w

Re: [algogeeks]

2011-08-14 Thread aditya kumar
the input should start with \ and end with \ . in between you can take any string . On Sun, Aug 14, 2011 at 6:35 PM, Poised~ wrote: > small correction in my above explanation > > the %[^\"] will accept the input till it doesn't encounter a " > Missed the ^ (XOR) operation completely. > > -- > Y

Re: [algogeeks] Re: TREE question

2011-08-13 Thread aditya kumar
void find(struct node * tree,struct node *subtree) { if((tree==NULL )||(subtree==NULL)) return ; else { printf("the data being compared are tree:%d subtree:%d \n",tree->data,subtree->data); if((tree->data)==(subtree->data)) { flag=1; find(tree->left,subtree->left); find(tree->right,subtree->rig

Re: [algogeeks] Re: Problems on Linked List

2011-08-12 Thread aditya kumar
@mohit : +1 On Sat, Aug 13, 2011 at 9:20 AM, Raghavan wrote: > First question: > >- .Read the data from the first list and put it in a stack >- Traverse the next list and compare by reading elements from the stack >- This would solve it > > > Second question: > >- Take an list li

Re: [algogeeks] cisco

2011-08-12 Thread aditya kumar
is CISCO cuming fr recruitment ?? they are in huge loss and they have sacked around 1 employees . On Fri, Aug 12, 2011 at 7:18 PM, sukran dhawan wrote: > can anybody tell abt the interview process in cisco ? > > -- > You received this message because you are subscribed to the Google Groups >

Re: [algogeeks]

2011-08-11 Thread aditya kumar
printf("%d",((int)((int *)0 + 1))*8); o/p :: 32/64 On Thu, Aug 11, 2011 at 5:14 PM, sukran dhawan wrote: > thanks > > > On Thu, Aug 11, 2011 at 5:02 PM, Aditya Virmani > wrote: > >> u can never find tht thru ur prgm...sizeof int is compiler dependant >> whether its 32/64 bit... >> >> On Thu,

Re: [algogeeks] Problems on Linked List

2011-08-10 Thread aditya kumar
1)for the fst one you dont have to reverse the linked list just traverse the linked list recursively and read it from back . correct me if m wrong ! On Thu, Aug 11, 2011 at 12:41 AM, Piyush Kapoor wrote: > thanks all > > > On Thu, Aug 11, 2011 at 12:21 AM, siddharam suresh < > siddharam@gm

Re: [algogeeks]

2011-08-08 Thread aditya kumar
check this link http://indiabix.com/ On Mon, Aug 8, 2011 at 10:58 PM, sukran dhawan wrote: > can anyone plz help me where can v get the aptitude questions (i meant the > site) > > -- > You received this message because you are subscribed to the Google Groups > "Algorithm Geeks" group. > To post t

Re: [algogeeks] MS test

2011-08-07 Thread aditya kumar
4) c 40%300=120 sec and you got to finish in 150 sec 60%300=180sec so basically we got to finish 180sec work in 30 sec so we need 6 processor .. this is wot i thought while attempting this question i gave this written test ! On Sun, Aug 7, 2011 at 8:54 PM, iama wrote: > I am a little skeptic ove

Re: [algogeeks] Re: sizeof() question.

2011-07-27 Thread aditya kumar
sizeof calculates at compile time so their is no function call . in case of function it gives the size of return type of that function On Wed, Jul 27, 2011 at 9:41 PM, Abhinav Arora wrote: > ya Amit is right... > sizeof(main()) will return 4 because main will return an > integer.however it wi

Re: [algogeeks] Re: size of self referential structure

2011-07-26 Thread aditya kumar
char *s[5] is a array of pointers of type char . but the thing is size of pointers is 4byte irrespective of its type . coz address is always an unsigned int which is of 4byte. On Tue, Jul 26, 2011 at 7:11 PM, Puneet Gautam wrote: > @everyone: > I have this mind strangling doubt..!!! > > Why is "ch

Re: [algogeeks] size of self referential structure

2011-07-26 Thread aditya kumar
@akshata: here padding wont come into picture coz int a =4byte, char *b[5]=4*5byte, *link=4byte all are multiple of 4 . ans will be 28 byte On Tue, Jul 26, 2011 at 6:42 PM, Akshata Sharma wrote: > why isn't padding done here? We have seen previous posts on size of > structures, where due to paddi

Re: [algogeeks] Graph Based Problems

2011-07-26 Thread aditya kumar
all graph problem need not use tree . most of them can be implemented using array . On Tue, Jul 26, 2011 at 3:11 PM, Dipankar Patro wrote: > Love your idea Navneet, but I have seen in general that Graph algos are > difficult to convert into code (at least for me!) May be that's the reason > why

Re: [algogeeks] C OUTPUT

2011-07-24 Thread aditya kumar
t helps! > > On Mon, Jul 25, 2011 at 11:41 AM, aditya kumar < > aditya.kumar130...@gmail.com> wrote: > >> main() >> { >> int i = 257; >> int *iPtr = &i; >> printf("%d %d", *((char*)iPtr), *((char*)iPtr+1) ); >> } >> >

[algogeeks] C OUTPUT

2011-07-24 Thread aditya kumar
main() { int i = 257; int *iPtr = &i; printf("%d %d", *((char*)iPtr), *((char*)iPtr+1) ); } can any one explain me the o/p ?? -- You received this message because you are subscribed to the Google Groups "Algorithm Geeks" group. To post to this group, send email to algogeeks@googlegroups.com. To

Re: [algogeeks] Re: Long string and the first non-repeating character

2011-07-18 Thread aditya kumar
use hash table.characters count will be stored on the basis of their ascii value . ie a's count will be stored in array[97] . at last just check the count of each . count==1 gives u the first non repeating character On Tue, Jul 19, 2011 at 12:31 AM, aditi garg wrote: > @sagar ur solution is very

Re: [algogeeks] Re: Expression evaluation in C

2011-07-18 Thread aditya kumar
the behaviour is undefined since computer dsnt know which i to evaluate first . On Mon, Jul 18, 2011 at 6:15 PM, SAMMM wrote: > This has to do with lvalue . because i++ require some place to store > it value . > > On Jul 18, 1:10 pm, XYZ wrote: > > I was also thinking about the order of express

Re: [algogeeks] Re: C Doubts

2011-07-17 Thread aditya kumar
11 bytes are > padded. Possibly depends on your system hardware's synchronization with the > compiler. > > > On Mon, Jul 18, 2011 at 1:27 AM, aditya kumar < > aditya.kumar130...@gmail.com> wrote: > >> @Nikhil >> why is Address of long double : starts at 11

Re: [algogeeks] Re: C Doubts

2011-07-17 Thread aditya kumar
;>> actually first see your post, you have written o/p=24 accordingly padding >>> done is perfect. But actually its printing 16. >>> So now question arises of padding >>> >>> and its pareek not prateek :) >>> >>> >>> On Mo

Re: [algogeeks] Re: C Doubts

2011-07-17 Thread aditya kumar
12. So padding concept is perfectly working >>> >>> >>> On Mon, Jul 18, 2011 at 12:26 AM, aditya kumar < >>> aditya.kumar130...@gmail.com> wrote: >>> >>>> struct st >>>> { >>>> char ch1; >>>&

Re: [algogeeks] Re: C Doubts

2011-07-17 Thread aditya kumar
@prateek . can you explain me ?? i dint get padding logic in this example of mine. On Mon, Jul 18, 2011 at 12:30 AM, sagar pareek wrote: > sizeof long double is 12. So padding concept is perfectly working > > > On Mon, Jul 18, 2011 at 12:26 AM, aditya kumar < > aditya.kum

Re: [algogeeks] Re: C Doubts

2011-07-17 Thread aditya kumar
struct st { char ch1; long double ld; }s; printf("%d",sizeof(s)); //output : 24 (for 32-bit compiler) ->as i have mentioned above the behaviour is undefined in case of sizeof (struct) can any one explain me why the padding concept does not work here ?? On Mon, Jul 18, 2011 at 12:13 AM, Pa

Re: [algogeeks] C Doubts

2011-07-17 Thread aditya kumar
1) you cannot change the const variable . 2) generally sizeof behaviour in case of structure is just undefined. Either it follows the summation of size of members or it uses padding concept ie in your example 4 byte each for character(1 byte for char rest of the 3 bytes is padded up) and 4 byte for

  1   2   >