Re: [algogeeks] Programs

2011-09-11 Thread Kamakshii Aggarwal
@neha:can u pls explain ur method? On Sun, Sep 11, 2011 at 9:09 PM, sukran dhawan wrote: > ya +1 to neha use bitset concept in c++ > > > On Sun, Sep 11, 2011 at 8:24 PM, Neha Singh wrote: > >> for ques 1 use bit manipulation >> its more efficient >> >> -- >> You received this message because you

Re: [algogeeks] IOCL

2011-09-09 Thread Kamakshii Aggarwal
dr's get shortlisted and den direct interview..no written test On Fri, Sep 9, 2011 at 10:27 PM, Dheeraj Sharma wrote: > can anyone tell me the procedure for IOCL? > paper nd all > > -- > *Dheeraj Sharma* > Comp Engg. > NIT Kurukshetra > +91 8950264227 > > -- > You received this message because

Re: [algogeeks] os

2011-09-07 Thread Kamakshii Aggarwal
@mohit:answer is 19.one is the parent process originally.and 19 more processes have been created. On Wed, Sep 7, 2011 at 11:21 PM, Mohit Goel wrote: > 20 is not in option ..so whats the answer?? > > -- > You received this message because you are subscribed to the Google Groups > "Algorithm G

Re: [algogeeks] activation record

2011-09-02 Thread Kamakshii Aggarwal
what are activation records?? On Fri, Sep 2, 2011 at 9:00 PM, sukran dhawan wrote: > true > > > On Fri, Sep 2, 2011 at 7:44 PM, priya ramesh < > love.for.programm...@gmail.com> wrote: > >> Allocation and deallocation of activation records is always done using a >> stack >> (LIFO) structure. True

Re: [algogeeks] Re: finding duplicates

2011-08-30 Thread Kamakshii Aggarwal
t; On Aug 30, 1:34 pm, Kamakshii Aggarwal wrote: > > develop an algorithm to find duplicates in a list of numbers without > using a > > binary tree..if there are n distinct numbers in the list ,how many times > > must two numbers be compared for equality in your a

Re: [algogeeks] c doubt

2011-08-30 Thread Kamakshii Aggarwal
@prateek:can u pls explain y the o/p will be 8??according to me also o/p should be 4. On Tue, Aug 30, 2011 at 11:42 PM, PRATEEK VERMA wrote: > @kartik it's wrong output...output will be 8 bytes.I asked this question > just to give more clear picture of bit field > > -- > You received this messag

[algogeeks] finding duplicates

2011-08-30 Thread Kamakshii Aggarwal
develop an algorithm to find duplicates in a list of numbers without using a binary tree..if there are n distinct numbers in the list ,how many times must two numbers be compared for equality in your algorithm?what if all numbers are equal? -- Regards, Kamakshi kamakshi...@gmail.com -- You rece

Re: [algogeeks] C puzzle

2011-08-29 Thread Kamakshii Aggarwal
http://ideone.com/o4r4o but it is calling red and green just two times each.. On Mon, Aug 29, 2011 at 11:06 PM, rajeev bharshetty wrote: > @Anup : I think you should also try to compile and check the answer... > May be I am wrong But compiler won't > > > On Mon, Aug 29, 2011 at 11:02 PM, Anu

Re: [algogeeks] C puzzle

2011-08-29 Thread Kamakshii Aggarwal
@rajeev:can u pls explain? On Mon, Aug 29, 2011 at 10:09 PM, rajeev bharshetty wrote: > Each of the red and green are being called 10 times.. > > > On Mon, Aug 29, 2011 at 9:41 PM, Anup Ghatage wrote: > >> If I'm not mistaken, >> >> red() will be called 6 times and green() will be called 10 time

Re: [algogeeks] Que of Tejas Network

2011-08-28 Thread Kamakshii Aggarwal
@rohit:i got my mistake..insteat of arr[2]=x[2]; it should be arr[2]=max{x[1],x[2]} so now my code goes lyk this let arr[] stores the value of max amount upto each shop that they can rob. arr[1]=x[1]; arr[2]=max{x[1],x[2]}; for(i=3;i<=n;i++) { arr[i]=max{(arr[i-2]+x[i]),arr[i-1]}; } arr[n] gi

Re: [algogeeks] algo ques

2011-08-28 Thread Kamakshii Aggarwal
t+2 <= N) > { Printf (" -->two steps -->") call printPath (length+2) } > > else >return; > } > On Sun, Aug 28, 2011 at 6:54 PM, Kamakshii Aggarwal > wrote: > >> what is the initial value of length that u r passing?? >> >> On Su

Re: [algogeeks] algo ques

2011-08-28 Thread Kamakshii Aggarwal
what is the initial value of length that u r passing?? On Sun, Aug 28, 2011 at 6:47 PM, prashant thorat wrote: > Hi, you can do this by recursion , > > printPath (int length) > { > if(lenght == N) return; > else > { > if(lenght+1 >= N) { Printf (" -->one step -->") call printPath > (length+1)

Re: [algogeeks] Que of Tejas Network

2011-08-28 Thread Kamakshii Aggarwal
let arr[] stores the value of max amount upto each shop that they can rob. arr[1]=x[1]; arr[2]=x[2]; for(i=3;i<=n;i++) { arr[i]=max{(arr[i-2]+x[i]),arr[i-1]}; } arr[n] gives the max amount that can be robbed... correct me if i am wrong. @prag:has tejas networks visited ur campus? On Sun, Aug 28

Re: [algogeeks] Tejas networks

2011-08-27 Thread Kamakshii Aggarwal
networks-placement-papers.html > coz i thnk..u r frnd of one of mah close frnd ;) > > On Sat, Aug 27, 2011 at 11:45 PM, Kamakshii Aggarwal < > kamakshi...@gmail.com> wrote: > >> can anyone tell about tejas networks recruitment procedure? >> and also what topic

[algogeeks] Tejas networks

2011-08-27 Thread Kamakshii Aggarwal
can anyone tell about tejas networks recruitment procedure? and also what topics are being asked? -- Regards, Kamakshi kamakshi...@gmail.com -- You received this message because you are subscribed to the Google Groups "Algorithm Geeks" group. To post to this group, send email to algogeeks@goog

Re: [algogeeks] SAP!!

2011-08-21 Thread Kamakshii Aggarwal
which college? On Sun, Aug 21, 2011 at 8:56 PM, rashmi i wrote: > > Hey, SAP is visiting our college. Any idea about the pattern of the campus > selection process? As in type of questions asked? Thanks > -- > R@$!-! > "DoN'T LimIt Ur cHaLlEngeS, ChAlLenGe uR LImItS." > > -- > You received this

Re: [algogeeks] Doubt

2011-08-21 Thread Kamakshii Aggarwal
But on dev c it is showing o/p as 2 2 .. I too have a doubt,a similar question was asked in atrenta's written paper. On Sun, Aug 21, 2011 at 8:14 PM, Ankur Khurana wrote: > can somebody please explain this ? > > > On Sun, Aug 21, 2011 at 8:08 PM, Nikhil Gupta > wrote: > >> http://www.ideone.com/

Re: [algogeeks] C dot

2011-08-19 Thread Kamakshii Aggarwal
@aditi: ab c-dot ka kya karna hai tujhe?:P On Fri, Aug 19, 2011 at 7:26 PM, aditi garg wrote: > Do u knw wat type of ques asked in interviews? > Plz post a few as example if u knw...please... > > On Fri, Aug 19, 2011 at 7:25 PM, aditi garg wrote: > >> k thanx :) >> >> >> On Fri, Aug 19, 2011 at 7

Re: [algogeeks] Re: mcq-os

2011-08-16 Thread Kamakshii Aggarwal
the one which rajeev posted.. On Tue, Aug 16, 2011 at 8:00 PM, nivedita arora wrote: > hey yar whch book are you doing for OS mcq ?? > > > On Aug 15, 6:07 pm, Kamakshii Aggarwal wrote: > > I am confused about the race around..according to me it should be > included >

Re: [algogeeks] mcq-os

2011-08-15 Thread Kamakshii Aggarwal
@rajeev:thanks a lot..the link is really very nice..:) On Mon, Aug 15, 2011 at 7:41 PM, rajeev bharshetty wrote: > @kamakshi : Check this link. > It has a very good explanation > > http://stargazer.bridgeport.edu/sed/projects/cs503/Spring_2001/kode/os/sync.htm > > > On Mon, Aug 15, 2011 at 6:37 P

Re: [algogeeks] Operators

2011-08-15 Thread Kamakshii Aggarwal
@rajeev:+1 On Mon, Aug 15, 2011 at 6:50 PM, rajeev bharshetty wrote: > Does context dependent means a single operator having different meaning > when used in different contexts or scenarios??? > If so then * is dereferencing operator for pointers and also an arithmetic > operator > as *a pointer

Re: [algogeeks] operating system mcq

2011-08-15 Thread Kamakshii Aggarwal
@rajeev: this link is not working... On Mon, Aug 15, 2011 at 4:21 PM, rajeev bharshetty wrote: > Timothy J William MCQ's > > > http://s244.filesonic.in/download/1662179664/4e47a18f/6312d950/0/1/b4d72a29/0/49e7f6c2daf916cf807a0678329c153d3324519b > > > On Mon, Aug 15, 2011 at 3:24 AM, nivedita aro

Re: [algogeeks] mcq-os

2011-08-15 Thread Kamakshii Aggarwal
> They help in process synchronization by allowing multiple processes access > to a common shared memory . > and they also solve the problem of mutual exclusion allowing only a single > process in a critical region at a time. > > Correct me if i am wrong. > > On Mon, Aug

Re: [algogeeks] Operators

2011-08-15 Thread Kamakshii Aggarwal
* - used for multiplication as well as dereferencing & =use for bit wise and and also for address # also i guess On Mon, Aug 15, 2011 at 6:45 PM, aditi garg wrote: > Pick the operators whose meaning is context dependent? > 1. * > 2.# > 3.& > 4.No such operator exists > Plz gv the diff contexts i

[algogeeks] mcq-os

2011-08-15 Thread Kamakshii Aggarwal
semaphores are used to solve the problem of? 1.process synchronization 2.race around 3.mutual exclusion. -- Regards, Kamakshi kamakshi...@gmail.com -- You received this message because you are subscribed to the Google Groups "Algorithm Geeks" group. To post to this group, send email to algogee

Re: [algogeeks]

2011-08-14 Thread Kamakshii Aggarwal
@arun : first " is the requiremnet of the given scanf format..whenever next " is encountered it stops accepting any character due to [^\"] On Mon, Aug 15, 2011 at 9:16 AM, Arun Vishwanathan wrote: > so according to the discussions above input should start with " and end > with " but also there is

Re: [algogeeks]

2011-08-14 Thread Kamakshii Aggarwal
@aditya" i think the input should start with " and also end with " On Sun, Aug 14, 2011 at 6:38 PM, aditya kumar wrote: > 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

Re: [algogeeks] os

2011-08-14 Thread Kamakshii Aggarwal
s from there and and unlocks the mutex at point > of exit. This can be done by associating a tokken with the thread that it > is executing in critical section and what mutex it locked. O we can do this > by making some table in Process control block. > > On Sat, Aug 13, 2011 at

Re: [algogeeks]

2011-08-14 Thread Kamakshii Aggarwal
>>> >>>> the series can be started as >>>> T(1)=1 >>>> T(2)=2 >>>> and calculate the rest from above >>>> >>>> On Sat, Aug 13, 2011 at 8:37 PM, Gaurav Menghani < >>>> gaurav.mengh...@gmail.c

Re: [algogeeks]

2011-08-14 Thread Kamakshii Aggarwal
@rahul:y the o/p will be just a space? On Sun, Aug 14, 2011 at 1:10 PM, rahul aravind wrote: > scanf takes input anything as well..but the output will be just a space > > > On Sun, Aug 14, 2011 at 1:08 PM, Rajeshwar Patra > wrote: > >> >> >> how does scanf takes the input ??? >> >> >>> -- >>

Re: [algogeeks] Adobe Interview Question

2011-08-13 Thread Kamakshii Aggarwal
typo in above code..find t(n+1) On Sun, Aug 14, 2011 at 12:37 AM, Kamakshii Aggarwal wrote: > if steps are between banks then try dis. > if n=3 steps > then find t(n+2) > and use the fibonacci formula t(n)=t(n-1)+t(n-2) > t(1)=1; > t(2)=2; > now this will work ... > >

Re: [algogeeks] Adobe Interview Question

2011-08-13 Thread Kamakshii Aggarwal
if steps are between banks then try dis. if n=3 steps then find t(n+2) and use the fibonacci formula t(n)=t(n-1)+t(n-2) t(1)=1; t(2)=2; now this will work ... On Sun, Aug 14, 2011 at 12:34 AM, Kamakshii Aggarwal wrote: > i am sorry.i misinterpret the question...i dint c that the steps

Re: [algogeeks] Adobe Interview Question

2011-08-13 Thread Kamakshii Aggarwal
i am sorry.i misinterpret the question...i dint c that the steps are between banks.. On Sun, Aug 14, 2011 at 12:26 AM, ankit tyagi wrote: > seems fine.. > > > On Sun, Aug 14, 2011 at 12:13 AM, Mohit Goel wrote: > >> there are 5 possibilities ..5th one is_12_..other as specified by >> ankit

Re: [algogeeks] Adobe Interview Question

2011-08-13 Thread Kamakshii Aggarwal
coz i have tried a similar question like dis...also u can check it also... On Sat, Aug 13, 2011 at 10:47 PM, Decipher wrote: > How did you know that ? > > -- > You received this message because you are subscribed to the Google Groups > "Algorithm Geeks" group. > To view this discussion on the we

Re: [algogeeks] Array question: Detect whether a circular chain with all elements can be formed

2011-08-13 Thread Kamakshii Aggarwal
i got error,my sol will not work for all cases On Sat, Aug 13, 2011 at 10:22 PM, Kamakshii Aggarwal wrote: > see the following example: > *a*kdhd*a* ,*b*hdgd*c*, *c*hdjd*b* > > > On Sat, Aug 13, 2011 at 10:20 PM, Yasir wrote: > >> why following? >> >

Re: [algogeeks] Array question: Detect whether a circular chain with all elements can be formed

2011-08-13 Thread Kamakshii Aggarwal
see the following example: *a*kdhd*a* ,*b*hdgd*c*, *c*hdjd*b* On Sat, Aug 13, 2011 at 10:20 PM, Yasir wrote: > why following? > > if(first==last) > return false; > > > example: > axxa, ayyb, bzza ===> ayybbzzaaxxa > > -- > You received this message because you are subscribed to the Google Gr

Re: [algogeeks] Adobe Interview Question

2011-08-13 Thread Kamakshii Aggarwal
yes nth term of fibonacci series. .t(n)=t(n-1)+t(n-2); where t(1)=1; t(2)=2; On Sat, Aug 13, 2011 at 10:11 PM, aseem garg wrote: > The soln is nth term of fibonacci sequence...isnt it? > > Aseem > > > > On Sat, Aug 13, 2011 at 9:27 PM, Akash Mukherjee wrote: > >> dp problem, refer to dp from AF

Re: [algogeeks] Array question: Detect whether a circular chain with all elements can be formed

2011-08-13 Thread Kamakshii Aggarwal
maintain an array indexed on alphabets 'a' to 'z'. now count the occurence of each character taking *last character* of each string {"asdsb","csasaa", "bc", bc"} in this case arr[a]=1; arr[b]=1; arr[c]=2; now start with each sting let first character be first and last character be last wh

Re: [algogeeks]

2011-08-13 Thread Kamakshii Aggarwal
yes On Sat, Aug 13, 2011 at 8:30 PM, Puneet Goyal wrote: > 1 or 2 stairs? > > > On Sat, Aug 13, 2011 at 8:24 PM, Kamakshii Aggarwal > wrote: > >> >> Given n stairs, how many number of ways can you climb if u use either 1 or >> 2 at a time? >> -- >&g

[algogeeks]

2011-08-13 Thread Kamakshii Aggarwal
Given n stairs, how many number of ways can you climb if u use either 1 or 2 at a time? -- Regards, Kamakshi kamakshi...@gmail.com -- 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.co

[algogeeks] os

2011-08-13 Thread Kamakshii Aggarwal
How do you make sure to unlock a mutex which was locked in a thread that dies/terminates? -- Regards, Kamakshi kamakshi...@gmail.com -- 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.

[algogeeks] n*n array

2011-08-13 Thread Kamakshii Aggarwal
is printing a n*n array,spirally is same as printing it helically?? or is there any difference between the two?? -- Regards, Kamakshi kamakshi...@gmail.com -- 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] mcq

2011-08-09 Thread Kamakshii Aggarwal
please explain On Tue, Aug 9, 2011 at 9:07 AM, Dipankar Patro wrote: > ans : n + 2nk - k^2 - k > > > > On 9 August 2011 08:43, Raman wrote: > >> Yes, the answer is n + 2nk - k^2 -k >> >> -- >> You received this message because you are subscribed to the Google Groups >> "Algorithm Geeks" group.

Re: [algogeeks] amazon question

2011-08-08 Thread Kamakshii Aggarwal
> int p1= fork(); >> >> if (p1 == 0) { >> >> int p2 = fork(); >> >> if (p2 != 0) { >> >> fork(); >> >> } >> >> } >> >> } >> >&g

Re: [algogeeks] mcq

2011-08-08 Thread Kamakshii Aggarwal
s ques mean > smthing else? > > > On Mon, Aug 8, 2011 at 10:58 PM, Kamakshii Aggarwal > wrote: > >> i copied it from net..i dint understand the question. ignore the >> options..are u able to solve it? >> >> >> On Mon, Aug 8, 2011 at 10:16 PM, aditi garg

Re: [algogeeks] mcq

2011-08-08 Thread Kamakshii Aggarwal
i copied it from net..i dint understand the question. ignore the options..are u able to solve it? On Mon, Aug 8, 2011 at 10:16 PM, aditi garg wrote: > b) and c) options are same?? > > On Mon, Aug 8, 2011 at 8:53 PM, Kamakshii Aggarwal > wrote: > >> A k-diagonal matrix is a

Re: [algogeeks] Re: amazon question

2011-08-08 Thread Kamakshii Aggarwal
\/ \ >>>>> /\ >>>>> M C4 >>>>> C2 C5 C1C6 C3 C7 >>>>>

[algogeeks] mcq

2011-08-08 Thread Kamakshii Aggarwal
A k-diagonal matrix is a n *n square matrix in which the elements on the principal diagonal and k diagonals above the principal diagonal and k diagonals below the principal diagonal only have none\ zero elements. Other elements are zero’s. In order to save the space, the non zero elements are stor

Re: [algogeeks] Re: amazon question

2011-08-08 Thread Kamakshii Aggarwal
... > > > On Mon, Aug 8, 2011 at 12:53 PM, Shachindra A C wrote: > >> At the point of execution of the 4th fork(), there are 8 processes i.e, >> the 4th fork will get executed 8 times. The final value of ret will depend >> on this fork. the fork will return 0 in the 8 c

Re: [algogeeks] os

2011-08-08 Thread Kamakshii Aggarwal
astava wrote: > >> named pipes!!! >> >> On Mon, Aug 8, 2011 at 5:36 PM, Kamakshii Aggarwal > > wrote: >> >>> >>> Fastest IPC mechanism is >>> >>>1. ?shared memory >>>2. ?pipes >>>3. ?nam

[algogeeks] os

2011-08-08 Thread Kamakshii Aggarwal
Fastest IPC mechanism is 1. ?shared memory 2. ?pipes 3. ?named pipes 4. ?Semaphores -- Regards, Kamakshi kamakshi...@gmail.com -- You received this message because you are subscribed to the Google Groups "Algorithm Geeks" group. To post to this group, send

[algogeeks] mcq

2011-08-08 Thread Kamakshii Aggarwal
global variable conflicts due to multiple file occurence is resolved during a. compile-time b. run-time c. link-time d. load-time -- Regards, Kamakshi kamakshi...@gmail.com -- You received this message because you are subscribed to the Google Groups "Algorithm Geeks" group. To post to this gro

Re: [algogeeks] mcq

2011-08-08 Thread Kamakshii Aggarwal
how??array is not sorted...so first we have to sort na?? On Mon, Aug 8, 2011 at 5:04 PM, Dipankar Patro wrote: > C > > > On 8 August 2011 17:03, ankit sambyal wrote: > >> C >> >> -- >> You received this message because you are subscribed to the Google Groups >> "Algorithm Geeks" group. >> To po

Re: [algogeeks] mcq

2011-08-08 Thread Kamakshii Aggarwal
source file >> >> >> On Mon, Aug 8, 2011 at 4:18 PM, sourabh jakhar >> wrote: >> >>> b >>> >>> >>> >>> On Mon, Aug 8, 2011 at 4:18 PM, Kamakshii Aggarwal < >>> kamakshi...@gmail.com> wrote: >>> >

[algogeeks] mcq

2011-08-08 Thread Kamakshii Aggarwal
A 1D - array A whose size is N is given and is divided into P partitions and an element x is to be searched in the array. Each partition is given to one processor. The elements are searched with in the partition using a binary search. What is the time complexity of the algorithm? (a) O (N/P) (b) O

[algogeeks] mcq

2011-08-08 Thread Kamakshii Aggarwal
Which is not an advantage of using subroutines? (a) Easier maintenance (b) Runtime reduces (c) Storage space reduces (d) Modularity one of the answer is b. what about c? does subroutine reduce space? -- Regards, Kamakshi kamakshi...@gmail.com -- You received this message because you

Re: [algogeeks] o/p

2011-08-08 Thread Kamakshii Aggarwal
thanks..got it... On Mon, Aug 8, 2011 at 3:45 PM, jagrati verma wrote: > #define max(a,b)((a>b)?a:b) > > use parenthese thn it will giv the correct o/p > > On Mon, Aug 8, 2011 at 3:27 PM, Kamakshii Aggarwal > wrote: > > #include > > > > #define max(a,b)

Re: [algogeeks] help--code

2011-08-08 Thread Kamakshii Aggarwal
cause of higher cache hits than Code 2. > > On Mon, Aug 8, 2011 at 3:25 PM, Gaurav Menghani > wrote: > > If the dimensions are same, both will execute equally fast. > > > > On Mon, Aug 8, 2011 at 3:21 PM, Kamakshii Aggarwal > > wrote: > >> > >>

[algogeeks] o/p

2011-08-08 Thread Kamakshii Aggarwal
#include #define max(a,b)(a>b)?a:b int main() { int m,n; m=3+max(2,3); n=2*max(3,2); printf("%d,%d",m,n); getchar(); return 0; } y the o/p is 2,3,,please explain -- Regards, Kamakshi kamakshi...@gmail.com -- You received this message because you are subscribed to the Google Grou

[algogeeks] help--code

2011-08-08 Thread Kamakshii Aggarwal
which code executes faster? code1:- for(i=0;ihttp://groups.google.com/group/algogeeks?hl=en.

Re: [algogeeks] Re: amazon question

2011-08-08 Thread Kamakshii Aggarwal
then please elaborate? On Mon, Aug 8, 2011 at 12:34 PM, Pradex wrote: > get it..!! :) :) > > On Aug 7, 10:49 pm, Shachindra A C wrote: > > 8 one's and 8 two's. The order in which they get printed might vary. > > > > On Mon, Aug 8, 2011 at 1

[algogeeks] amazon question

2011-08-07 Thread Kamakshii Aggarwal
what will be the o/p of the following program: main() { int ret; ret=fork(); ret=fork(); ret=fork(); ret=fork(); if(!ret) printf("one"); else printf("two"); } -- Regards, Kamakshi kamakshi...@gmail.com -- You received this message because you are subscribed to the Google Groups "Algor

Re: [algogeeks] Re: Probability Puzzle

2011-08-07 Thread Kamakshii Aggarwal
i think the answer will be 1/5+ 4/5*1/2=3/5 coz the question is saying what is the probability of getting head* sixth time*(when 5 heads were already there).. it is not saying what is the probability of getting heads* 6 times*..(in this case answer will be 17/180) On Mon, Aug 8, 2011 at 9:54 A

Re: [algogeeks] output help

2011-08-07 Thread Kamakshii Aggarwal
pe, but not when you define the type. > Aseem > > > > On Mon, Aug 8, 2011 at 12:29 AM, Kamakshii Aggarwal > wrote: > >> #include >> int main() >> { >>typedef static int *i; >> static int j; >> i a = &j; >> printf("%d"

[algogeeks] output help

2011-08-07 Thread Kamakshii Aggarwal
#include int main() { typedef static int *i; static int j; i a = &j; printf("%d", *a); getchar(); return 0; } what is the error in the code? -- Regards, Kamakshi kamakshi...@gmail.com -- You received this message because you are subscribed to the Google Groups "Algorithm Geeks" gr

Re: [algogeeks] Re: o/p

2011-08-07 Thread Kamakshii Aggarwal
fun(&p) hona tha.. but i wrote(*p) On Mon, Aug 8, 2011 at 12:17 AM, aseem garg wrote: > What was the mistake? > Aseem > > > > On Mon, Aug 8, 2011 at 12:15 AM, Kamakshii Aggarwal > wrote: > >> i got my mistake...sorry guys >> >> >>

[algogeeks] Re: o/p

2011-08-07 Thread Kamakshii Aggarwal
i got my mistake...sorry guys On Mon, Aug 8, 2011 at 12:14 AM, Kamakshii Aggarwal wrote: > what is the problem with the following code > > void fun(int **p) > { > static int q = 10; > > *p = &q; > } > > int main() > { > int r = 20; > int

[algogeeks] o/p

2011-08-07 Thread Kamakshii Aggarwal
what is the problem with the following code void fun(int **p) { static int q = 10; *p = &q; } int main() { int r = 20; int *p = &r; fun(*p); printf("%d", *p); getchar(); return 0; } -- Regards, Kamakshi kamakshi...@gmail.com -- You received this message because you are subs

Re: [algogeeks] Re: Probability Puzzle

2011-08-07 Thread Kamakshii Aggarwal
17/80..what is the correct answer On Sun, Aug 7, 2011 at 11:25 PM, saurabh chhabra wrote: > sry...its wrong > > On Aug 7, 10:34 pm, Algo Lover wrote: > > A bag contains 5 coins. Four of them are fair and one has heads on > > both sides. You randomly pulled one coin from the bag and tossed it 5 >

[algogeeks] amazon

2011-08-07 Thread Kamakshii Aggarwal
1.what is the best sorting method for almost sorted array? a.quicksort c.hapsort c.shell sort d.bubble -- Regards, Kamakshi kamakshi...@gmail.com -- You received this message because you are subscribed to the Google Groups "Algorithm Geeks" group. To post to this group, send email to algogeeks

Re: [algogeeks] difference between the two

2011-08-05 Thread Kamakshii Aggarwal
in case of 64 bit, size of second structure will also be 16 not 8 On Fri, Aug 5, 2011 at 11:40 PM, UTKARSH SRIVASTAV wrote: > I think voth are just same.. > > > On Fri, Aug 5, 2011 at 10:57 AM, priya v wrote: > >> in case of 64 bit machine y doesn't padding happen in the 2nd stru

[algogeeks] probablity

2011-08-05 Thread Kamakshii Aggarwal
I was given 3 packets, with 2 pens each. 1st Packet has 2 blue pens. 2nd Packet has 1 blue pen,1 black pen. 3rd Packet has 2 black pens. I took any one packet and pulled out one pen. It turned out to be a blue one. What is the probability that the next pen from the same packet will also be

Re: [algogeeks] output???

2011-08-05 Thread Kamakshii Aggarwal
the reason is dat 0.7 is treated as double..therefore double(0.7) >float(0.7) On Fri, Aug 5, 2011 at 8:20 PM, kartik sachan wrote: > the output will be hi > > even if u have putted equal to sign there this is becoz 0.7 do not exactly > stored like 0.7 in a but some thing lesser as describe in ASC

Re: [algogeeks] Re: Printf

2011-08-05 Thread Kamakshii Aggarwal
logical address On Fri, Aug 5, 2011 at 2:20 PM, Amol Sharma wrote: > physical address i think > -- > > > Amol Sharma > Third Year Student > Computer Science and Engineering > MNNIT Allahabad > > > > > On Fri, Aug 5, 2011 at 1:01 AM, amit karmakar > wrote: > >> Some discussions here, >> http://u

[algogeeks] hash table

2011-08-05 Thread Kamakshii Aggarwal
can we implement random() function on a hash table in O(1) . -- Regards, Kamakshi kamakshi...@gmail.com -- 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 thi

Re: [algogeeks] pls help

2011-08-05 Thread Kamakshii Aggarwal
@gaurav:i got it..thanks for the solution On Fri, Aug 5, 2011 at 2:34 PM, Kamakshii Aggarwal wrote: > @gaurav:can u please explain what is the purpose of this line.. > s.push_back('-'); > > > On Fri, Aug 5, 2011 at 1:10 PM, Nitin Nizhawan > wrote: > >> Or on

Re: [algogeeks] pls help

2011-08-05 Thread Kamakshii Aggarwal
ng alphabet; >> int maxlen; >> void backtrack(string s,int l) >> { >> if(l==maxlen) { cout<> s.push_back('-'); >> for(int i=0;i>{ s[l]=alphabet[i]; backtrack(s,l+1); } >> } >> >> int main() >> { >> maxlen=3; >>

Re: [algogeeks] pls help

2011-08-05 Thread Kamakshii Aggarwal
@gaurav:i could not understand ur sol.can u explain it again.. On Fri, Aug 5, 2011 at 12:32 PM, Gaurav Menghani wrote: > On Fri, Aug 5, 2011 at 12:20 PM, Kamakshii Aggarwal > wrote: > > given a set of letters and a length N, produce all possible output.(Not > > permutation).

[algogeeks] pls help

2011-08-04 Thread Kamakshii Aggarwal
given a set of letters and a length N, produce all possible output.(Not permutation). For example, give the letter (p,o) and length of 3, produce the following output(in any order you want, not just my example order) ppp ppo poo pop opp opo oop ooo another example would be given (a,b) and length

Re: [algogeeks] amazon

2011-08-04 Thread Kamakshii Aggarwal
with initial k bits > some were puzzles easy one > > yes i only remembered 2 question of coding > they were > 1. find longest increasing sub sequence > 2. print matrix in spiral form... > > now u tell me ur college and how and which companies visited urs ? > &

Re: [algogeeks] Re: Amazon Aptitude questions

2011-08-04 Thread Kamakshii Aggarwal
i have a doubt regarding 3rd questions..acc to me both are valid...what is the correct answer? On Fri, Aug 5, 2011 at 12:27 AM, newOne wrote: > 2 issues: > 1. no error handling for malloc failure( can be ignored) > 2. no memset for p&q. > > strcat will not work properly: as by definition it will

Re: [algogeeks] amazon

2011-08-04 Thread Kamakshii Aggarwal
gt;> >> On Thu, Aug 4, 2011 at 11:01 PM, Kamakshii Aggarwal < >> kamakshi...@gmail.com> wrote: >> >>> @arvind:in technical online test,do we have to code the program? >>> >>> >>> On Thu, Aug 4, 2011 at 10:45 PM, arvind kumar wrote: >

Re: [algogeeks] Puzzle

2011-08-04 Thread Kamakshii Aggarwal
@sagar:please explain.. On Thu, Aug 4, 2011 at 11:59 PM, sagar pareek wrote: > 87.5 % > > > On Thu, Aug 4, 2011 at 10:39 PM, Nikhil Gupta > wrote: > >> There are 3 magical wells. Any input quantity of water we provide the 1st >> well is returned double (of this double, half is kept inside the w

Re: [algogeeks] Re: Give an efficient search algo

2011-08-04 Thread Kamakshii Aggarwal
@dave:how can we find value of 'k' in (log n) On Thu, Aug 4, 2011 at 5:41 PM, kartik sachan wrote: > @amit it's given that array is increasing then decreasing..so where > there is change from incre to drece that value of i in loop will be k > > in this we can find out k if not given > > -

Re: [algogeeks] amazon

2011-08-04 Thread Kamakshii Aggarwal
t; On Thu, Aug 4, 2011 at 10:25 PM, arvind kumar wrote: >> >>> Written test(tech+apti),Technical interview n HR interview >>> >>> >>> On Thu, Aug 4, 2011 at 10:23 PM, Kamakshii Aggarwal < >>> kamakshi...@gmail.com> wrote: >>> >

[algogeeks] merging of two sorted arrays

2011-08-04 Thread Kamakshii Aggarwal
how can two sorted arrays be merged inplace? -- Regards, Kamakshi kamakshi...@gmail.com -- 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 em

[algogeeks] amazon

2011-08-04 Thread Kamakshii Aggarwal
Can anyone please tell what is the procedure for amazon campus recruitment? -- Regards, Kamakshi kamakshi...@gmail.com -- 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 unsub

Re: [algogeeks] Re: Amazon Aptitude questions

2011-08-03 Thread Kamakshii Aggarwal
0+36+36) >>> >>> =18/31 >>> >>> is it one of the options? >>> >>> >>> On Wed, Aug 3, 2011 at 10:28 PM, JAIDEV YADAV wrote: >>> >>>> there is no error in first question ... u thik so.. correct me if wrong >>>

Re: [algogeeks] Re: Amazon Aptitude questions

2011-08-03 Thread Kamakshii Aggarwal
i think answer for 5th should be 11/23. Am i right? On Wed, Aug 3, 2011 at 10:26 PM, Kamakshii Aggarwal wrote: > i think dere is nothing wrong in ques 1.is there any error? > > > On Wed, Aug 3, 2011 at 9:46 PM, cegprakash wrote: > >> 2 is pretty easy.. >> >>

Re: [algogeeks] Re: Amazon Aptitude questions

2011-08-03 Thread Kamakshii Aggarwal
i think dere is nothing wrong in ques 1.is there any error? On Wed, Aug 3, 2011 at 9:46 PM, cegprakash wrote: > 2 is pretty easy.. > > 3: both > > 5: 6/12 * 6/11 = 3/11 > > am i right? > > -- > You received this message because you are subscribed to the Google Groups > "Algorithm Geeks" group.

Re: Re: [algogeeks] aptitude

2011-08-03 Thread Kamakshii Aggarwal
is constant..so two milestones with > reverse numbers wil hv difference as 9x-9y i.e multiple of 9..also third > milestone wil be very near to 100 to so 1 is fixed as a digit..odrs can be > found out by hit and trial.. > > > > VM > > NSIT, COE, 3rd year > > &g

Re: [algogeeks] aptitude

2011-08-03 Thread Kamakshii Aggarwal
eryone gets it when looking > at the answer... > > > On Wed, Aug 3, 2011 at 3:34 PM, wrote: > >> 45 km/hr >> >> VM >> NSIT, COE, 3rd year >> >> >> On , Kamakshii Aggarwal wrote: >> > A car is traveling at a uniform speed.The driver s

[algogeeks] aptitude

2011-08-03 Thread Kamakshii Aggarwal
A car is traveling at a uniform speed.The driver sees a milestone showing a 2-digit number. After traveling for an hour the driver sees another milestone with the same digits in reverse order.After another hour the driver sees another milestone containing the same two digits. What is the average sp

Re: [algogeeks] Re: MS

2011-08-02 Thread Kamakshii Aggarwal
@vaibhav:can u please elaborate? On Tue, Aug 2, 2011 at 6:31 PM, Vaibhav Mittal wrote: > dynamic programming with binary search should do it.. > > Regards > VM > NSIT, COE, 3rd yr > > > On Tue, Aug 2, 2011 at 6:19 PM, Kamakshii Aggarwal > wrote: > >> @sunny:y

Re: [algogeeks] Re: MS

2011-08-02 Thread Kamakshii Aggarwal
@sunny:yes all the squares should be of same size On Tue, Aug 2, 2011 at 5:03 PM, Poised~ wrote: > @ narain- > i didn't see that coming. thanks for the heads up. > > -- > You received this message because you are subscribed to the Google Groups > "Algorithm Geeks" group. > To view this discussio

[algogeeks] MS

2011-08-01 Thread Kamakshii Aggarwal
Given a rectangle with known width and height, design an algorithm to fill the rectangle using n squares(n is integer given) and make sure in the result the wasting area is minimized. Length of square doesn't have to be integer. i.e, given width=3,height=2,n=5, one solution is that rectangle can be

Re: [algogeeks] Any help on bits?

2011-07-31 Thread Kamakshii Aggarwal
@what kind of operations can be applied to 'A'? On Sun, Jul 31, 2011 at 6:54 PM, Amol Sharma wrote: > yupxor would do the required task eaisly !! > > -- > > > Amol Sharma > Third Year Student > Computer Science and Engineering > MNNIT Allahabad > > > > > On Sun, Jul 31, 2011 at 6:42 PM, Nikh

Re: [algogeeks]

2011-07-30 Thread Kamakshii Aggarwal
covers next 20 bits. and so >>>>>> on. >>>>>> >>>>>> where as &(*(a+1)) points to 1st element,&(*(a+2)) points to 2nd >>>>>> element and so on. >>>>>> >>>>>> i hope this helps >

Re: [algogeeks] Output Help.

2011-07-30 Thread Kamakshii Aggarwal
depend from compiler to >> compiler. but yeah it should be undefined. >> >> >> On Sun, Jul 31, 2011 at 1:49 AM, Kamakshii Aggarwal < >> kamakshi...@gmail.com> wrote: >> >>> @sanchit:it is undefined.. >>> >>> >>> On Sun, J

Re: [algogeeks]

2011-07-30 Thread Kamakshii Aggarwal
haan haan,i got my mistake,thanks On Sun, Jul 31, 2011 at 1:49 AM, Sanchit Manchanda wrote: > sorry. yeah likhen mein galti kardi. but take the point what i was trying > to say. &(a+1) to galat hai. > > > On Sun, Jul 31, 2011 at 1:47 AM, Kamakshii Aggarwal > wrote: > >

  1   2   >