d then the
'bishop' diagonal.
The bishop test is a bit tricky, it looks at (x rows up, y columns across
from a previously placed queen)
If x and y are equal it's on the diagonal.
--
Geoffrey Summerhayes
On Sunday, July 8, 2012 8:00:54 PM UTC-4, Victor Manuel Grijalva Altamira
On Jan 7, 10:10 am, Vijay wrote:
> Thanks for response.
>
> Can you please tell me what will be the contains of Hash table and how
> searching works?
>
> Lets say, we have one data like
> Key Data
> ===
> IP1 - Sys1
> IP8 Sys8
> IP2 Sys2
>
> Lets say, there are keys "IP1" a
On Jan 6, 2:54 pm, Vijay wrote:
> Hi All,
>
> I have one question about Hashing.
>
> Say I have one Hash table where
> index Hash_function(key) function will return index value of
> corresponding string/key.
> Hash_insert(key) function it will take key and get converted index
> value using Hash_fu
On Dec 9, 2:52 am, sankethm7 <74.san...@gmail.com> wrote:
> Hello folks,
> does anyone have idea to solve the problem given below:
>
> Assume that A[1…n] is an array
> a. Describe an efficient parallel algorithm that uses n processors to
> find the majority element of A
> time comple
ogn.
> > Any ideas guys ?
>
> > -- Vinod
>
> > On Dec 2, 11:02 pm, Geoffrey Summerhayes wrote:
>
> > > On Dec 2, 10:42 am, Geoffrey Summerhayes wrote:
>
> > > > It's a binary tree, [ 7 3 4 1 2 6 5 8] has children
> > > > [ 7 3 4
On Dec 2, 10:42 am, Geoffrey Summerhayes wrote:
>
> It's a binary tree, [ 7 3 4 1 2 6 5 8] has children
> [ 7 3 4 1 2 6 5] and [ 3 4 1 2 6 5 8], all the way
> down to [ 7 3] [3 4] [4 1] ...
>
> If you start at the bottom keeping track of min and max
> for each node, if
On Dec 2, 6:45 am, Vinoth Kumar wrote:
> These are the steps for the O(n^2) solution
>
> n=length of A
> for each subarray A[i,j] where j>i
> min=min(A[i,j])
> max=max(A[i,j])
> if(max - min==size (A[i,j]) print A[i,j]
>
> min[A[i,j]]=min( A[j], min(A[i,j-1])
> similar one
On Nov 25, 5:31 pm, bingbang wrote:
> Dear all,
> I am a newbie here, this is my first post. I have looked over a few
> algorithms and have searched this board for my question but have not
> been able to narrow down to a clear answer.
>
> I am looking for any pointers/code/advice to help decide
Hmmm. Same idea, much more analysis.
I feel good, I spent a lot less time thinking
about it. Splitting the search areas into
squares is a great idea.
--
Geoff
On Nov 25, 8:43 am, Rohit Saraf wrote:
> A research article on this question..
>
> Rohit Saraf
> Sophomore
> Computer Science and Enginee
Not a bad start, it can eliminate areas.
n >n >n >n
?? ?? ?? ?? >n >n >n >n
?? ?? ?? ?? >n >n >n >n
So it would involve searching in
the two remaing blocks, recursively
until you get an 1xN or Mx1
then a binary search on the row
or column.
--
Geoff
On Nov 25, 3:46 am, Bharath wrote:
> You can
On Nov 6, 11:08 am, ankur aggarwal wrote:
> @geoffery
> plz give your method..
Simple enough, xe's analysis is correct,
except xe starts at L1. The ant starts at
the origin and moves to L1 with a probability
of 1, accounting for one extra minute.
So the answer is eight.
--
Geoff
--
You receiv
Google - Watts Brothers square hole drills.
Not completely square leaves slightly rounded corners.
On Oct 27, 8:05 am, eSKay wrote:
> Can we drill a square hole by using a Reuleaux triangle, atleast
> theoretically?
--~--~-~--~~~---~--~~
You received this message
On Oct 26, 12:56 pm, eSKay wrote:
> This is one of the old puzzles, but I couldn't reason out how ppl get
> to the answer they say.
>
> "An ant has to crawl from one corner of a room to the diametrically
> opposite corner as quickly as possible. If the dimensions of the room
> are 3 x 4 x 5, wha
On Oct 3, 4:49 am, eSKay wrote:
> okay...
>
> perhaps
> "It's a 2-player game that's deterministic, zero-sum, perfect
> information, finite, and without ties. So a winning strategy exists
> for one of the players."
> should have been mentioned... I didn't know that.
>
> Btw, what is the proof o
On Oct 2, 7:20 am, eSKay wrote:
> What exactly do you prove here?
>
The first player always has a winning move.
> You just make some statements, which should be proved. shouldn't it?
>
> Or am I missing something??
>
It's a 2-player game that's deterministic, zero-sum,
perfect information, f
On Sep 15, 11:10 am, CM Saikanth Varma
wrote:
> The answer is indeed 56.
> Explanation: Increment operator has highest priority
> so (i++)*(i++) will be evaluated as
> (7)*(8)=56
> This is valid only in C
>
I don't have the final c99 standard available, this is from the draft:
5.1.2.3 Program
On Sep 15, 9:15 am, nitin mathur wrote:
> @ Tanmoy
> Same logic I explained..interviewer didn't give me any clue whether
> the explaination is correct or not..
>
> but when I googled it now I found the answer 56.
Still not correct. The standard was specific (I assume the
latest version hasn't
On Sep 11, 10:32 am, Karthik Singaram Lakshmanan
wrote:
> The deal is that if anyone chooses seat 1 then everyone else will go
> to their proper places and person 100 will get seat 100
>
> The probability of passenger 1 choosing seat 1 is (1/100)
> Say, he chooses seat (a_1) where (1 < a_1 < 10
Here's what I'm working on now...
Given a rectangular map m by n projected from a place on earth
determine the xy coords on the map given a list latitude and
longitude.
Now the tricky part, don't know the type of projection beforehand
except
that the map has no holes, missing corners or tears an
On Aug 27, 5:19 am, ankur aggarwal wrote:
> Implement the birthday diary calendar to keep records of all birthdays of
> your friends
> 1) what underlying data structure(s) you will use so that the memory
> consumption should be optimum [i.e if you have only 12 birthday entries you
> should no
On Aug 29, 2:05 pm, nagendra kumar wrote:
> Given a n-ary tree of resources arranged hierarchically. A process
> needs to lock a resource node in order to use it. But,
> A node cannot be locked if any of its descendant or ancestor is
> locked.
> I was supposed to
> -> write the structure of n
On Sep 1, 8:02 pm, Ramaswamy R wrote:
> Brute force, pick all combinations and keep track of minimum difference.
> Complexity: O(n^2) - (n-1)+(n-2)+(n-3) ... 1
> A little better, use any of the O(nlog n) sorting algorithm. In O(n) compare
> adjacent pairs and find the minimum difference. Comple
On Aug 23, 5:00 am, Dufus wrote:
> Idea is simple either to keep a count and emit elements with odd count
> (frequency) or XOR element with itself for each time it occurs in
> input and then emit elements which have non zero XORed result(which
> basically corresponds to elements with odd freque
On Aug 13, 5:49 am, Arthur Milfait wrote:
> hi there,
>
> actually i am programming a software that loads numbers for radios in
> a trunking system from a file and has to check each number if it is a
> number for a group of radios. criterion to be the number of a
> radiogroup is, that the numbe
On Jul 6, 12:34 pm, lad4bear wrote:
> Hi Guys,
>
> Here is my situation.
>
> The set of room types available is [s, d, t]. A user specifies the
> number of rooms required [n] and I have to generate a list of
> permutations.
>
> So where n=3 we get [sss, ssd, sst, sdt, std, etc]
>
> The problem
On Apr 6, 10:32 pm, James wrote:
> A puzzle I'd not seen before appeared in a recent copy of The
> Independent, called Slitherlink.
>
> Seehttp://en.wikipedia.org/wiki/Slitherlinkandhttp://www.puzzle-loop.com/
>
> To quote the rules verbatim:
>
> "Draw a single loop by connecting together the d
On Dec 11, 11:03 am, "Miroslav Balaz" wrote:
> i think it will not perform good, if you have cards like this 1 2 3 4 5 5 5
> 5
Actually it's not all that bad in this case, it terminates when it
reaches the first occurence of 5. (1 2 3 4 5 5 5 5 5) is much
worse.
> the supposed solution is, keep
On Dec 9, 2:22 pm, Tower <[EMAIL PROTECTED]> wrote:
> A bank has a collection of n bank cards that they’ve confiscated,
> suspecting them of being used in a fraud. Each bank card corresponds
> to a unique account in the bank. Each account can have many cards
> corresponding to it, and we’ll say
On Nov 26, 5:07 pm, "Miroslav Balaz" <[EMAIL PROTECTED]> wrote:
> That was joke? I never heard of any dancing links :)
Google is a wonderful tool. In the time it took to write your reply,
you
could have been reading the original paper.
> the algorithm in more detail
> let the grid by n rows m c
On Nov 26, 1:40 pm, "Miroslav Balaz" <[EMAIL PROTECTED]> wrote:
>
> It is too slow, i replied with better solution , bu i dont know how this
> forum works.
>
I was looking for comments on correctness, not efficency.
As I said, it can be improved. By quite a bit, actually.
As for your 'better sol
On Nov 25, 6:34 pm, "[EMAIL PROTECTED]" <[EMAIL PROTECTED]> wrote:
> Hello,
>
> I'm trying to write an algorithm counting all possible ways (symmetry
> included) a grid of dimensions NxM can be covered with a prescribed
> subset of pentominoes. (http://en.wikipedia.org/wiki/Pentomino). The
> alg
On Nov 20, 11:58 pm, Ralph Boland <[EMAIL PROTECTED]> wrote:
> On Nov 20, 1:46 pm, Monty <[EMAIL PROTECTED]> wrote:
>
> > Hi Frndz,
>
> > If there are n points on the circumference of circle(order not
> > known) ,how can we find out the closest pair in complexity O(nlgn)...
>
> > pls help wi
On Nov 5, 9:01 am, "Adrian Godong" <[EMAIL PROTECTED]> wrote:
> Yes, but that'll be too complex. I have tried the string.compare and it
> works like wonder! Shave off a lot of computing time.
>
WTF!?
Using a pipe delimited string and string operations to keep track
of over 1000 values is the s
On Oct 15, 3:32 am, moonlight <[EMAIL PROTECTED]> wrote:
> I wanted to check if this algorithm would work for me, but apparently
> it's kept secret. I searched through wiki, google, etc. but could not
> find any resource in any programming language. Could anyone point me
> to a good algorithm libr
On Oct 13, 10:52 am, "sharad kumar" <[EMAIL PROTECTED]> wrote:
> its possible
> take gn array.
> find median
> then split arraay in two halves
> split it till it becomes smallest no.
> then exchange each even no with odd and merge them.= till u get original
> array.
> almost the reverse form of
On Oct 9, 4:00 am, moonlight <[EMAIL PROTECTED]> wrote:
<*snip*>
> Obviously, some input data may yield this not solvable, such as when
> user defines imageMinSide smaller than the width of target area.
> The algorithm should collect satisfying results and return the one
> with the largest num
On Jul 22, 12:32 am, popeyerayaz <[EMAIL PROTECTED]> wrote:
> Gentleman,
>
> I have the following question:
>
> 9. Present an example of a logic bug using pseudocode and explain your
> answer. (10 points) I just want the group to verify if my answer is
> correct.
> Here is my answer:
>
> Temperatu
On Jun 24, 2:16 pm, "M. Funkibut" <[EMAIL PROTECTED]> wrote:
>
> But how do you get from RGB to the paint formula? Can you go from a
> paint formula to RGB? Does anybody know where I can find a reference
> book/article on this? I've looked and come up empty.
Don't really know how they did it.
On Jun 23, 12:36 pm, zee <[EMAIL PROTECTED]> wrote:
> do we have an algo for finding the union of two sets ???
Lots of them.
> data structure suitable for set operations
Depends. The only real constraint in the definition
of a set is that the elements are unique. So the
choice of structure
On Jun 22, 3:01 pm, Tejas Kokje <[EMAIL PROTECTED]> wrote:
> On Jun 11, 12:25 am, "zee 99" <[EMAIL PROTECTED]> wrote:
>
> > is this the best one even if the list is sorted ( or any other constraint
> > like this is applied ) ??
>
> > On 6/11/08, Mohammad Moghimi <[EMAIL PROTECTED]> wrote:
>
> >
On Jun 22, 7:45 pm, "Nat Padmanabhan" <[EMAIL PROTECTED]> wrote:
> This is not funny!
True, it's actually quite depressing.
> Skiplist is essentially an optimized version of Doug's idea that ends up
> using a logrithmically scaling vector of pointers. Secondly, linked lists in
> real scenarios m
On Jun 11, 12:09 pm, "Douglas Diniz" <[EMAIL PROTECTED]> wrote:
> Well, if you have a classic linked list, O(n) is the best for you. But you
> can do better if you have a sorted linked list. In every node keep a vector
> of pointers for all other nodes. Then you can simulate a binary search.
>
On Jun 11, 3:25 am, "zee 99" <[EMAIL PROTECTED]> wrote:
> On 6/11/08, Mohammad Moghimi <[EMAIL PROTECTED]> wrote:
>> On Wed, Jun 11, 2008 at 10:03 AM, zee99. 99 <[EMAIL PROTECTED]> wrote:
>>>
>>> is there any algo that can search a linked list in less than O(n) time
>>
>> No, I think O(n) is the
On Jun 6, 1:40 pm, "zee 99" <[EMAIL PROTECTED]> wrote:
> hi
>
> learnt that a tail recursive algorithm can be converted to a non recursive
> one by merely using a while and a goto
>
> is it true for all class of recursive algorithms or just the tail recursive
> ones ...
All. In fact there are s
On May 29, 10:43 am, "Akhil Ravidas" <[EMAIL PROTECTED]> wrote:
> On Thu, May 29, 2008 at 8:08 PM, Geoffrey Summerhayes <[EMAIL PROTECTED]>
> wrote:
>
> > Easiest way to find out implementation details is to
> > just read the header file on your impl
On May 29, 2:46 am, Vinodh <[EMAIL PROTECTED]> wrote:
> I am reading about hashing techniques.
> The map data structure available in C++ STL uses hashing techniques?
It's been more than a few years since I looked at the
standard, but I believe the actual algorithm is left
unspecified.
There are
On May 15, 4:33 pm, "Bruno Avila" <[EMAIL PROTECTED]> wrote:
> > Given the conditions for the subgraphs, it's always possible to create
> > a graph that limits the size of all the acceptable subgraphs to less
> > than
> > three nodes.
>
> In the problem, there are no constraints on the cardinalit
On May 15, 12:07 am, pramod <[EMAIL PROTECTED]> wrote:
> Geoff,
>
> How did you arrive at the V(V+1)/2 figure?
>
V nodes in the graph, so V trees consisting of a single node.
Then since the graph is given as connected, there must be a least
one path between each pair of nodes. Even if there is m
On May 14, 12:41 pm, "Bruno Avila" <[EMAIL PROTECTED]> wrote:
> (reformatting last email)
>
> These are good questions. In my problem, a binary tree is different if
> the set of nodes are different. For example:
>
> a We have 9 different binary trees: {a}, {b}, {c},
> \
On May 14, 8:39 am, pramod <[EMAIL PROTECTED]> wrote:
> Let's say we have E number of edges and V number of vertices.
> Any subgraph which is a tree with V vertices will have V-1 edges. So
> we need to retain V-1 edges and eliminate the rest E-(V-1). So in a
> brute force manner if we retain any s
On May 12, 8:20 pm, brunotavila <[EMAIL PROTECTED]> wrote:
> Hi people,
>
> How to calculate the number of binary trees that are subgraphs of a
> given connected, undirected, unweighted and simple (no parallel edges
> nor loops) graph?
Haven't given it too much thought, but I believe the number
On Feb 22, 9:01 am, Ridvan <[EMAIL PROTECTED]> wrote:
> Well if some preprocessing may be done just store the largest number
> and increase it.
>
> If the number has to be somewhere in between the 100 numbers I
> would do it in this way:
> Define a Range class: Range{int min, int max}
>
> In t
On Feb 6, 12:30 pm, robin <[EMAIL PROTECTED]> wrote:
> Hi
> I was trying to solve problem number 5 from 15th bulgarian
> informatics
> olympiad.
> on the following website:
>
> http://www.math.bas.bg/bcmi/noi99.html
>
> (we have to find the minimum and maximum possible values of numbers
> on
> t
53 matches
Mail list logo