[algogeeks] numbers

2011-02-10 Thread jalaj jaiswal
There is very long array of ints, and you are given pointer to base addr of
this array.. each int is 16bit representation... you need to return the
pointer to tht bit inside array where longest sequence of 1s start

take this simple example:
Array = {15,7,2,1,0,23}
,0111,0010,0001,,10111
^
Result: Pointer should point to 1st bit of number 15.


another example : ,0111,0011,1110,,10111
   _
third index from starting is the
answer i.e i=2 , if i start from 0 as it has maximum 1's(5)
-- 
With Regards,
*Jalaj Jaiswal* (+919019947895)
Software developer, Cisco Systems
Final Year Undergraduate,
IIIT ALLAHABAD

-- 
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, visit this group at 
http://groups.google.com/group/algogeeks?hl=en.



[algogeeks] Generating permutations with constraints

2011-02-10 Thread Nipun Batra
Given two sets of strings
set a=b8,b7b1
set b=c2,c1,c0

I wish to list out all the permutations of the form

b8c2 b7c2 b6c1 b5c1 b5c0 b5c0 b1c0 b1c0

of length 8 each wherein
the ordering is maintained like non increasing indices from set a and
also from set b.
A more formal defintion of the requirement would be to generate 8
tuple permutations of the form

bindex1cindex1 bindex2cindex2..bindexcindex8

where index1=index2=index3=...index8 for both b and c

What would be the suggested algorithm

-- 
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, visit this group at 
http://groups.google.com/group/algogeeks?hl=en.



[algogeeks] Re: Puzzle Will Stuck

2011-02-10 Thread bittu
well its game of Number Theory

There are 3 possibilities in any number set - prime numbers, non-prime
numbers (that are not squares)  squares.

In this puzzle the original state of a door will be reversed if it is
acted upon an odd number of times - otherwise the original state  the
final state will be the same. Now let us take each of the number types
I mentioned above.

its another Explanation How I will Approach to the Problem...

1. Prime numbers are divisible by themselves  1 - so they will be
acted upon an even number of times. So these doors (corresponding to
prime numbers) will be closed

2. Non-prime non-square numbers(15,27 etc) are divisible by
themselves, 1,  any other two numbers such as a*b where a is not
equal to b. Thus they are divisible at least by 4 numbers - which
means these doors will be closed as well.

3. Square numbers are divisible by themselves, 1  its factors a*a.
Since the factors are the same, these numbers are divisible by at
least 3 numbers - hence these doors will be open


Correct me If I am  wrong... Another Approach will b appreciated

Thanks  Regards
Shashank Mani  The best way to escape from a problem is to solve
it.

-- 
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, visit this group at 
http://groups.google.com/group/algogeeks?hl=en.



[algogeeks] Re: array problem

2011-02-10 Thread Dave
@Jalaj: What is the work for each of the operations? I presume that
get is O(1), but don't know if reverse is O(1) or O(end-start).

Dave

On Feb 10, 12:07 am, jalaj jaiswal jalaj.jaiswa...@gmail.com wrote:
 sort the input array. only following operations on array is allowed:
 1)get(index) -gets the element at that index
 2)reverse(int start,int end) - example reverse(1,3) for the array
 [1,2,3,4,5] will return [1,4,3,2,5]

 better then nlogn

 --
 With Regards,
 *Jalaj Jaiswal* (+919019947895)
 Software developer, Cisco Systems
 Final Year Undergraduate,
 IIIT ALLAHABAD

-- 
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, visit this group at 
http://groups.google.com/group/algogeeks?hl=en.



[algogeeks] Re: array problem

2011-02-10 Thread juver++
Cartesian tree will do.

-- 
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, visit this group at 
http://groups.google.com/group/algogeeks?hl=en.



Re: [algogeeks] Re: array problem

2011-02-10 Thread jalaj jaiswal
@ dave assume reverse also O(1)

@juver will you elaborate a bit dude

On Thu, Feb 10, 2011 at 8:21 PM, juver++ avpostni...@gmail.com wrote:

 Cartesian tree will do.

 --
 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, visit this group at
 http://groups.google.com/group/algogeeks?hl=en.




-- 
With Regards,
*Jalaj Jaiswal* (+919019947895)
Software developer, Cisco Systems
B.Tech IIIT ALLAHABAD

-- 
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, visit this group at 
http://groups.google.com/group/algogeeks?hl=en.



Re: [algogeeks] extendible hashing

2011-02-10 Thread Gene
If I remember correctly Berkeley DB uses an extensible hashing system or did 
at one time.  This is not part of the OS API, but rather a library that runs 
in user space.  

I've used the B-tree parts of Berkeley DB, though never the hash table. 
 Performance and reliability have been extremely good in a product that's 
running 24x7 on a server in 6 instances for 8 years now.  Never a hiccup.


 

-- 
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, visit this group at 
http://groups.google.com/group/algogeeks?hl=en.



[algogeeks] Good E-BOOK

2011-02-10 Thread DIPANKAR DUTTA
Any one has the E- book Algorithms For Interviews by Adnan Aziz. ?
It s a good book for algo,
please send download link..

thank u in advance

-- 
DIPANKAR DUTTA
M-TECH,Computer Science  Engg.
EC Dept,IIT ROORKEE
Uttarakhand , India – 247667
---
website:http://people.iitr.ernet.in/shp/09535009/Website/index.html
ph no-09045809987
Lab: 286454
email:dipan...@iitr.ernet.in

-- 
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, visit this group at 
http://groups.google.com/group/algogeeks?hl=en.