Re: [algogeeks] Re: Find all longest increasing subsequence of length k

2012-01-29 Thread Manni mbd
@Manee: can u explain a bit more !! still unclear On 1/30/12, Manee wrote: > store all the indices wherever the value decreases. all subsequences > between 0, these indices and the end index n are increasing > subsequences. > > Check which of these are of length K. > > > > On Jan 26, 11:17 pm, at

Re: [algogeeks] decimal to binary..c code....

2012-01-29 Thread Rahul Kumar
ur subject is decimal to binary but in content u have written float to decimal... I don't get it On Sat, Jan 28, 2012 at 11:49 PM, rahul sharma wrote: > it should be able to convert not only int but also float like 190.345 to > decimalcan ny one suggest thnx in advance > > -- > You receiv

Re: [algogeeks] JAVA: Print all paths from root to leaf

2012-01-29 Thread atul anand
@Mihir : actually you are using linked listso you are keep on adding the nodes but not removing it..hence...you are getting wrong output.. i guess this should be done to fix the code. public static void paths(Node node, LinkedList list) { if(node == null) return; list.add(node.data)

[algogeeks] Re: Find all longest increasing subsequence of length k

2012-01-29 Thread Manee
store all the indices wherever the value decreases. all subsequences between 0, these indices and the end index n are increasing subsequences. Check which of these are of length K. On Jan 26, 11:17 pm, atul anand wrote: > Hi, > > suggest an algo which will find all longest increasing sub > seq

Re: [algogeeks] JAVA: Print all paths from root to leaf

2012-01-29 Thread Mihir Kulkarni
I only intend to print the root to leaf paths. The correct output should be: 721 725 It works fine when I use array instead of LinkedList. cheers, Mihir Kulkarni Graduate Student University of California, Irvine http://goo.gl/CvRcG On Sun, Jan 29, 2012 at 10:06 PM, Rujin Cao wrote: > Is the c

Re: [algogeeks] JAVA: Print all paths from root to leaf

2012-01-29 Thread Rujin Cao
Is the correct output 7 2 1 5 ? Did you intend to print the leaf node ? -- 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 algogee

[algogeeks] Find all longest increasing subsequence of length k

2012-01-29 Thread atul anand
Hi, suggest an algo which will find all longest increasing sub sequence of length K. for eg:- input : 7 8 9 4 10 11 K=3 output : 7 8 9 7 9 10 7 10 11 8 9 10 8 10 11 desired complexity : O(k*n*logn) -- You received this message because you are subscribed to the Google Groups "Algorithm Geeks"

[algogeeks] Spoj_problem:INUMBER

2012-01-29 Thread Anshul AGARWAL
hi friends, i m not able to find any logic to solve this problem. Can any one suggest me good algorithm of spoj_problem: (INUMBER ). thanx in advance -- You received this message because you are subscribed to the Google Groups "Algorithm Geeks" group. To

Re: [algogeeks] Re: Represent a number in base of minus 2 ????

2012-01-29 Thread saurabh singh
Use a pen and paper:) Generate a few numbers in base -2 by hand.You will get the logic. Saurabh Singh B.Tech (Computer Science) MNNIT blog:geekinessthecoolway.blogspot.com On Sun, Jan 29, 2012 at 11:44 PM, Zyro wrote: > 0 -- You received this message because you are subscribed to the Goo

[algogeeks] Kurukshetra 2012 OPC

2012-01-29 Thread radha krishnan
Hi Coderz, We would like to invite you all to participate in Kurukshetra OPC 2012 (An Individual Contest ), a 4-hour acm-icpc style online programming competition, which is organized as a part ofKurukshetra2012 , the Technical fest of Colleg

[algogeeks] Re: Represent a number in base of minus 2 ????

2012-01-29 Thread Zyro
@Anika 7 = 1*((-2)^4) + 1*((-2)^3) + 0*((-2)^2) + 1*((-2)^1) + 1*((-2)^0) ... simlilary for other numbers... -- 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 fr

Re: [algogeeks] Represent a number in base of minus 2 ????

2012-01-29 Thread Anika Jain
I didnt get the idea of minus 2, coz wen base is 2, we use digits 0 and 1, if its base , then digits from 0 to 7 and so on.. so for base -2, which digits go? On Sun, Jan 29, 2012 at 11:26 PM, Zyro wrote: > Write a function that takes an integer and returns a char array that > contains the -2 (m

[algogeeks] Represent a number in base of minus 2 ????

2012-01-29 Thread Zyro
Write a function that takes an integer and returns a char array that contains the -2 (minus 2) base representation of the given integer. Example: Input Output 7 11011 3 111 2 110 Plzzz help ??? -- You received this message because you are subscribed to the Google Groups "Algorithm Geeks"

Re: [algogeeks] someone pls explain the o/p??

2012-01-29 Thread Firoz Khursheed
@saurab...@gmail.com go it. +1 -- 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. For more o

Re: [algogeeks] someone pls explain the o/p??

2012-01-29 Thread saurabh singh
I once answered a similar question in stackoverflow.com http://stackoverflow.com/questions/8586722/comparing-unsigned-char-and-eof/8586867#8586867 Hope it helps... Saurabh Singh B.Tech (Computer Science) MNNIT blog:geekinessthecoolway.blogspot.com On Sun, Jan 29, 2012 at 6:54 PM, Firoz Khursheed

Re: [algogeeks] someone pls explain the o/p??

2012-01-29 Thread Firoz Khursheed
http://ideone.com/5uhz1 it seems that -ve number is always converted to unsigned, but this time x=3 is greater why? On Sun, Jan 29, 2012 at 3:14 PM, Saurabh Yadav wrote: > may be because when you compare unsigned number with signed number ,the > signed will changed to unsigned type and when si

Re: [algogeeks] Quick Sort

2012-01-29 Thread Moheed Moheed Ahmad
A typical implementation of quick sort works on quick sorting subarray and comparison is done in a linear manner that is a[i] is compared with pivot and then a[i+1] and so on. Virtual memory systems employ some sort of caching. Caching works on the principle of spatial locality of reference. That s

[algogeeks] [Combinatorics] count possible number of binary search trees, given number of nodes

2012-01-29 Thread Moheed Moheed Ahmad
I know how to solve it programatically, can anybody pls help me to solve it using combinatorics. -Moheed -- 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

Re: [algogeeks] someone pls explain the o/p??

2012-01-29 Thread Saurabh Yadav
may be because when you compare unsigned number with signed number ,the signed will changed to unsigned type and when signed will changed to unsigned type, it's MSB is one ,so y will be greater than x i am not sure about the reason i gave !! On Sun, Jan 29, 2012 at 2:25 PM, Ashish Sachdeva wrot

Re: [algogeeks] someone pls explain the o/p??

2012-01-29 Thread Piyush Kapoor
x>y is a mixed expression involving two operands of different types,one of unsigned int and other signed int.Since implicit type conversion takes place in such cases,the signed int is converted to unsigned int ,which means that -2(signed) is converted to 4294967294 (unsigned) .,and then the compa

[algogeeks] someone pls explain the o/p??

2012-01-29 Thread Ashish Sachdeva
http://ideone.com/Ily5v -- 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. For more options,