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
email to algogeeks@googlegroups.com. To unsubscribe 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

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

2012-01-06 Thread ADITYA KUMAR
. 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 because you are subscribed to the Google Groups Algorithm Geeks group. To post to this group, send

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 wujinchen...@gmail.com wrote: two month ago , I passed yahoo written test in china. data structure, algorithm , and given a code segment

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 shukla.rama...@gmail.comwrote: Hey mate dont worry there is nothing like

[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: 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 garg.sahi...@gmail.com wrote: how much package?? Sahil Garg Computer Engineering Delhi College of Engineering On Sun, Sep 25, 2011 at 1:32 AM, aditya kumar aditya.kumar130

[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)

[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] Re: Yahoo

2011-09-29 Thread aditya kumar
for the record which contains the substring and print top 10 record according to their frequency derive algo with complexity o(n) On Sep 26, 10:58 am, htross htb...@gmail.com wrote: can u explain more on the coding question u solved? On Sep 26, 9:08 am, aditya kumar

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 rajeevr...@gmail.comwrote: Technical Interview : - Tell me about yourself ? I emphasized more on my OpenSource projects and the Contribution to Amarok ( Video Player Project ). I

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 virmanisadi...@gmail.comwrote: 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 mcq's . 20 simple

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,

Re: [algogeeks] without using '-'

2011-09-26 Thread aditya kumar
+1 to abhishek On Mon, Sep 26, 2011 at 11:44 PM, Abhishek Gupta guptaabhishe...@gmail.comwrote: 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

Re: [algogeeks] Source Bits

2011-09-25 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 goyal.aanch...@gmail.comwrote:

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

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)

[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

Re: [algogeeks] Re: EMC^2

2011-09-24 Thread aditya kumar
on virtualization (virtual servers) and now moving towards cloud computing ALL THE BEST :) :) On Sep 24, 6:46 pm, aditya kumar aditya.kumar130...@gmail.com wrote: does any one have the idea about emc2 .?? if yes plz do share the details -- You received this message because you are subscribed

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 sivavikne...@gmail.comwrote: 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

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 crazyvishnu...@gmail.comwrote: 3584 On Sun, Sep 25, 2011 at 9:53 AM,

Re: [algogeeks] Flip kart

2011-09-23 Thread aditya kumar
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 On Fri, Sep 23, 2011 at 1:53 AM, aditya kumar aditya.kumar130...@gmail.com wrote: 11.5 fr our college

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

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 aditya.kumar130...@gmail.comwrote: 11.5 fr our college they will hve online test .. 3 coding question and u need to attempnt any two ..25mcq's

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 . ashima.b...@gmail.com 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

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 sukrandha...@gmail.comwrote: kadane s algo On Sat, Sep

Re: [algogeeks] Directi Questions - needed answers

2011-09-17 Thread aditya kumar
no. of 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 . ashima.b...@gmail.com wrote: ans 8: it should be 40

[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] 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

Re: [algogeeks] Min no of moves

2011-09-05 Thread aditya kumar
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, *$* gopi.komand...@gmail.com wrote: yes n/4 swaps are required. +1 aditya kumar On Sun, Sep 4, 2011 at 6:32 PM, aditya kumar aditya.kumar130...@gmail.com wrote: swap n/2-1

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 monugoya...@gmail.com 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 aditya.kumar130...@gmail.com wrote: @dheeraj : u are right . i dint read

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 sukrandha...@gmail.comwrote: 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

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 ghat...@gmail.com 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

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 nimish7andr...@gmail.com 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

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

[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

Re: [algogeeks] Re: Network Question

2011-09-04 Thread aditya kumar
those 2 be exist in same LAN ? If yes , how can router decides to which subnet it has to pass through the incoming packet .. On Fri, Sep 2, 2011 at 6:36 PM, aditya kumar aditya.kumar130...@gmail.comwrote: their wont be any conflict in ip address . coz within dhcp assigns ip

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 sukrandha...@gmail.comwrote: 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 networking

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 sukrandha...@gmail.comwrote: i think u missed a zero :) On Fri, Sep 2, 2011 at 5:49 PM, aditya kumar aditya.kumar130...@gmail.com wrote: Rs 100800 // this is CTC basic pay is around 7lakhs

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

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 manibharat...@gmail.comwrote: @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

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**

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 rahul23111...@gmail.comwrote: static variable is stored in data segement so it is alive thorugh the proggo through let us c : data types On Wed, Aug 31,

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 ghat...@gmail.com 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

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 raman.u...@gmail.com wrote: Q1. NODE* head //points to the bst(if it

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 rahul23111...@gmail.comwrote: i thnink it

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;i20;i++) { a=(s+a*a)/(2*a); } printf(square root is %f,a); } On Tue, Aug 30, 2011 at 6:00 PM, Sanjay Rajpal srn...@gmail.com wrote: Binary Search kind of mathod is useful here : float SquareRoot(float n,float start,float

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 pawanjalsa.t...@gmail.comwrote: @aditya kumar Will u plz explain

[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
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 usrivastav...@gmail.comwrote: good logic On Sun, Aug 28, 2011 at 12:14 AM, Piyush Grover piyush4u.iit...@gmail.com wrote: yeah you can

Re: [algogeeks] Re: c program

2011-08-28 Thread aditya kumar
problem is the 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 . eg system(cat filename) //system funtion

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 sivavikne...@gmail.comwrote: hi search this group.. u ll get lot of interview ques recently attended for ms On Aug 27, 10:58 am, rahul

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 cegprak...@gmail.com wrote: how does the above code work? On Fri, Aug 12, 2011 at 1:14 PM, Rahul raikra...@gmail.com wrote: I understand.

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 saurab...@gmail.com 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 --

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 saurabh...@gmail.comwrote: 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

Re: [algogeeks] AMAZON

2011-08-21 Thread aditya kumar
, 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 srn...@gmail.com wrote: which college ? Sanju :) -- You received this message because you are subscribed to the Google Groups Algorithm Geeks group

[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] AMAZON

2011-08-20 Thread aditya kumar
PESIT On Sat, Aug 20, 2011 at 4:23 PM, Sanjay Rajpal srn...@gmail.com 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

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 tosanjayraj...@gmail.comwrote: :) *Regards Sanju Happy to Help

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 dave_and_da...@juno.com wrote: @Radha: You could simulate long division. It would look something like this: int divide(int

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

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.8%

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 received

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 to the

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 sukrandha...@gmail.comwrote: 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.

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 access2ro...@gmail.comwrote: +1 to nitin On Wed, Aug 17, 2011 at 6:02 PM, Romil ... vamosro...@gmail.comwrote: People this is not the way to approach this

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 group. To

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~ dip10c...@gmail.com wrote: small correction in my above explanation the %[^\] will accept the input till it doesn't encounter a Missed the ^ (XOR) operation

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

Re: [algogeeks] array ques

2011-08-14 Thread aditya kumar
for(j=0;jn;j++) { if(a[j]==j) return j; else continue ; } this shud also be correct right ?? On Mon, Aug 15, 2011 at 12:31 AM, Akash Mukherjee akash...@gmail.comwrote: just my 2 cents in d binary search, replacing key with mid, ie if(a[mid] mid) check lower half else upper half

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 aditi.garg.6...@gmail.comwrote: @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

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

2011-08-14 Thread aditya kumar
15, 2011 at 12:45 AM, Amir Aavani amir.aav...@gmail.comwrote: 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 third row will be your o/p to print Do you mean O(n^3)? Consider this { O(n^2) }: 1

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 aditya.kumar130...@gmail.comwrote: yes On Mon, Aug 15, 2011 at 12:58 AM, aditi garg aditi.garg.6...@gmail.comwrote

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

2011-08-14 Thread aditya kumar
...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 5 8 12 18 2 6 7 3 fr dis matrix how will u find max and min?? On Mon, Aug 15, 2011 at 1:04 AM, aditya kumar aditya.kumar130...@gmail.com wrote: just

Re: [algogeeks] Re: Problems on Linked List

2011-08-13 Thread aditya kumar
@mohit : +1 On Sat, Aug 13, 2011 at 9:20 AM, Raghavan its...@gmail.com 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

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-right); }

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 sukrandha...@gmail.comwrote: can anybody tell abt the interview process in cisco ? -- You received this message because you are subscribed to

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 sukrandha...@gmail.comwrote: thanks On Thu, Aug 11, 2011 at 5:02 PM, Aditya Virmani virmanisadi...@gmail.comwrote: u can never find tht thru ur prgm...sizeof int is compiler dependant

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 pkjee2...@gmail.com wrote: thanks all On Thu, Aug 11, 2011 at 12:21 AM, siddharam suresh

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 sukrandha...@gmail.comwrote: 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

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 dip10c...@gmail.com 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

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 akshatasharm...@gmail.comwrote: why isn't padding done here? We have seen previous posts on size of

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 puneet.nsi...@gmail.comwrote: @everyone: I have this mind strangling

[algogeeks] C OUTPUT

2011-07-25 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] C OUTPUT

2011-07-25 Thread aditya kumar
:41 AM, aditya kumar aditya.kumar130...@gmail.com wrote: 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

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 somnath.nit...@gmail.com wrote: This has to do with lvalue . because i++ require some place to store it value . On Jul 18, 1:10 pm, XYZ yourarunb...@gmail.com wrote: I was

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 aditi.garg.6...@gmail.comwrote:

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

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,

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 sagarpar...@gmail.comwrote: sizeof long double is 12. So padding concept is perfectly working On Mon, Jul 18, 2011 at 12:26 AM, aditya kumar aditya.kumar130

Re: [algogeeks] Re: C Doubts

2011-07-17 Thread aditya kumar
, aditya kumar aditya.kumar130...@gmail.com wrote: @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 sagarpar...@gmail.comwrote: sizeof long double is 12. So padding concept is perfectly working On Mon, Jul

Re: [algogeeks] Re: C Doubts

2011-07-17 Thread aditya kumar
done is perfect. But actually its printing 16. So now question arises of padding and its pareek not prateek :) On Mon, Jul 18, 2011 at 12:38 AM, aditya kumar aditya.kumar130...@gmail.com wrote: @prateek . can you explain me ?? i dint get padding logic in this example of mine. On Mon

Re: [algogeeks] Re: Some adobe interview questions.

2011-07-05 Thread aditya kumar
boolean palindromeCheck(String string) { len=string.length(); if((string.length()1)) { if((string.charAt(0)==string.charAt(len-1))) { str=; str=str+string.substring(1,(len-1)); palindromeCheck(str); } else { flag=false; } } return flag; } THis also works fine if you dont want to use pointer

Re: [algogeeks] Re: Some adobe interview questions.

2011-07-05 Thread aditya kumar
Q3. ans:7000 i guess this is also a correct answer and no unique soln as such On Wed, Jul 6, 2011 at 12:37 AM, aditya kumar aditya.kumar130...@gmail.comwrote: boolean palindromeCheck(String string) { len=string.length(); if((string.length()1)) { if((string.charAt(0)==string.charAt

Re: [algogeeks] Re: Some adobe interview questions.

2011-07-05 Thread aditya kumar
a moment before posting your solution, and think whether it is write or wrong! On Jul 6, 12:11 am, aditya kumar aditya.kumar130...@gmail.com wrote: Q3. ans:7000 i guess this is also a correct answer and no unique soln as such On Wed, Jul 6, 2011 at 12:37 AM, aditya kumar aditya.kumar130

Re: [algogeeks] Re: Some adobe interview questions.

2011-07-05 Thread aditya kumar
@piyush : thanks i thot most significant bit was take as fisrt figure . On Wed, Jul 6, 2011 at 1:03 AM, Piyush Kapoor pkjee2...@gmail.com wrote: 7 occurs 1 time... so 8th digit is 1 On Wed, Jul 6, 2011 at 1:02 AM, aditya kumar aditya.kumar130...@gmail.com wrote: in 7000 : '0' occurs

Re: [algogeeks] Recurrence Relation

2011-07-02 Thread aditya kumar
answer is option A . On Sat, Jul 2, 2011 at 8:32 PM, KK kunalkapadi...@gmail.com wrote: 3. Consider the following recurrence: T(n) = 2T(n ^ (1/2)) + 1 Which one of the following is true? (A) T(n) = (loglogn) (B) T(n) = (logn) (C) T(n) = (sqrt(n)) (D) T(n) = (n) Can we solve this using

Re: [algogeeks] Re: Interview Question

2011-07-02 Thread aditya kumar
xor will only result if corresponding elements are same . what if in both the array set of integers are same but they arnt corresponding to each other ?? On Sun, Jul 3, 2011 at 2:37 AM, Dumanshu duman...@gmail.com wrote: xor all the elements of both arrays ==0 sum of 1st array == sum of 2nd

Re: [algogeeks] Re: Interview Question

2011-07-02 Thread aditya kumar
question How would you find the second largest element in an array using minimum no of comparisons?Any thing better than O(n).? On Sun, Jul 3, 2011 at 2:41 AM, aditya kumar aditya.kumar130...@gmail.com wrote: xor will only result if corresponding elements are same . what if in both

Re: [algogeeks] c output:

2011-06-30 Thread aditya kumar
@harry: it ll b btr if u go to this link n clr ur doubts link : http://en.wikipedia.org/wiki/Comma_operator On Fri, Jul 1, 2011 at 3:56 AM, hary rathor harry.rat...@gmail.com wrote: program 1; output :1 int main() { int i; i= 1,2,3; printf(i:%d\n,i);

  1   2   >