i have been trying this problem first i brute forced it and i was
right using brute force but can someone suggest a BFS solution to the
problem
http://uva.onlinejudge.org/index.php?option=com_onlinejudgeItemid=8category=6page=show_problemproblem=347
suggest something better than brute force
--
please suggest a solution for this problem using BFS i m nt able to
get how we apply bfs here though brute force would do
http://uva.onlinejudge.org/index.php?option=com_onlinejudgeItemid=8category=6
thnxx in advance please explain in detail so that i become able to
tackle such problems in
Since there are no more than 83681 unique words (and there are only 5letters
words), the simplest approach is using recursive function for words
generation (similar to DFS).
At each step add new letter which is greater than the last added (last
letter in the word).
Also it can be done using BFS
How can i count the number of digits 0s,1s,2s,3s,... 9s
in a number n
for example if n=33902
number of 0s=1
number of 3s=2
number of 9s=1
number of 2s=1
--
You received this message because you are subscribed to the Google Groups
Algorithm Geeks group.
To post to this group, send email to
Mod 10 and divide by 10 to get each digit and then hash that digit to an array
and add one to the array entry. Array from 0 to 9 and initialize to each array
value 0.
Sent from my BlackBerry
-Original Message-
From: rgap rgap...@gmail.com
Sender: algogeeks@googlegroups.com
Date: Tue,
If the number is larger that 64 bits then treat it as a string but do the same
thing apart from mod 10 divide bt 10.
Sent from my BlackBerry
-Original Message-
From: rgap rgap...@gmail.com
Sender: algogeeks@googlegroups.com
Date: Tue, 18 Jan 2011 03:31:12
To: Algorithm
This code prints the number of digits 0,1,2,... 9sbetween A and B
How does it works?
#include iostream
using namespace std;
int pot10(int i) {
int n = 1;
while (i--) n *= 10;
return n;
}
int digits(int n, int d) {
if (n 10 n d - 1) return d ? 1 : 0;
int s = 0, r = 0,
Thanks for the replies
@Sunny
Last year when they came to our college, they also asked questions
relating to Operating Systems and Database.
Did you forgot to mention it or is MS avoiding such questions now?
Regards
Rahul
--
You received this message because you are subscribed to the
there will be 1 or 2 rounds of telephonic interviews. How and what to
prepare for that?
--
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
hi guys,
Google is coming in my college for internship. Apart from general
algorithmic questions, can someone please tell me are there any specific
areas from where google mostly asks questions. I will appreciate any advice
regarding how to prepare for Google.
--
Harshal
--
You received this
digits(n, d) - returns how many times digit d is in the numbers [0, n].
--
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
from last 2 years they haven't asked questions on OS in written.
it depends
if written contains objective type questions also, OS may also be there
--
You received this message because you are subscribed to the Google Groups
Algorithm Geeks group.
To post to this group, send email to
from last 2 years i mean from last 2 years @IIT Roorkee
On Tue, Jan 18, 2011 at 6:12 PM, sunny agrawal sunny816.i...@gmail.comwrote:
from last 2 years they haven't asked questions on OS in written.
it depends
if written contains objective type questions also, OS may also be there
--
wch college u are 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,
Q1) How to declare a multidimensional array using new operator ??
Q2) What's the use of virtual friend function ? Give egs.
Q3) What's the order of construction of objects for a class Derived which -
contains an object of class Data1 , inherits a class Base1 and then
inherits virtual base class
nitk
On Tue, Jan 18, 2011 at 6:36 PM, shubham singh shubhamsisodia0...@gmail.com
wrote:
wch college u are 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
. There is an array, how will you partition that into two parts so
that the sum of both the sub set is minimum
--
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
@avpostnikov
In my reply I meant TCHAR ( maybe it doesnt apply to the example given in
the problem)
when your project is being compiled as Unicode, the TCHAR would translate to
wchar_t. If it is being compiled as ANSI/MBCS, it would translated to char
Not always we explicitly use wchar_t.
On
Do l values and r values hold any practical significance
how do we find l and r values of things like
\\*((A))\\
if A is an integer if A is an array of integers
If A in itself is a reference
--
Rahul K Rai
rahulpossi...@gmail.com
--
You received this message because you are
Pipeline : Choice B : 165 ( this pipeline wastes 20 ns between last 2 stages
for each item )
Scheduling : Choice B
Ram : Choice B
Synchronization : Choice B
On Mon, Jan 17, 2011 at 10:01 AM, Bhavesh agrawal agr.bhav...@gmail.comwrote:
On Mon, Jan 17, 2011 at 10:00 AM, Bhavesh agrawal
No. It can be applied to any positive number N.
The solution above splits the numbers by the least significant bit,
choose the group with missing number, and then drop the last bit and
continue.
In this way the set [0,N] is partitioned (almost) evenly into 2 groups:
{2k | k=0,1,...,N/2} and
Let G = (V, E) be a **, cONNECTED undirected graph. Give an O(V + E)-time
algorithm to compute
a path in G that traverses each edge in E exactly once in each direction.
Describe how you can
find your way out of a maze if you are given a large supply of pennies.
from clrs
--
You received this
Hi,
Can someone suggest good books/websites/blogs for interview related
questions.
thanks--
YS
--
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,
one possible solution can be that while storing the graph using adjacency
lists u can associate a color variable with each edge so that u color the
edge as u traverse it
like if u want to check wether edge (u,v) has been traversed while
traversing u's adjacecny list check wether (u,v) has been
thats cool i am from uptu google didnt visit here so no idea :D :D
--
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
Path you mentioned to find is an Euler-path. It can be traversed during DFS.
Here http://en.wikipedia.org/wiki/Eulerian_path is an algorithm.
--
You received this message because you are subscribed to the Google Groups
Algorithm Geeks group.
To post to this group, send email to
However, Eulerian path traverses each edge (in one direction) exactly once.
You may repeat the path in backward order. So you traverses edges in each
directions once.
--
You received this message because you are subscribed to the Google Groups
Algorithm Geeks group.
To post to this group,
Did you mean absolute difference between two subsets is minimal?
--
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
I found that Euler's algo cannot be applied here.
Please ignore my above posts.
--
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
But if we represent undirected edge (A, B) as (A-B) and (B-A) then after
this problem can be reduced to searching Eulerian path
--
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.
try http://www.careercup.com/
http://www.careercup.com/Thanks,
rajiv.
On Tue, Jan 18, 2011 at 7:57 AM, Yellow Sapphire pukhraj7...@gmail.comwrote:
Hi,
Can someone suggest good books/websites/blogs for interview related
questions.
thanks--
YS
--
You received this message because you
http://code-forum.blogspot.com
On Jan 19, 7:10 am, rajeev kumar rajeevprasa...@gmail.com wrote:
tryhttp://www.careercup.com/
http://www.careercup.com/Thanks,
rajiv.
On Tue, Jan 18, 2011 at 7:57 AM, Yellow Sapphire pukhraj7...@gmail.comwrote:
Hi,
Can someone suggest good
CALL FOR PAPERS
CGVR'11
The 2011 International Conference on Computer Graphics
and Virtual Reality
Date and Location: July 18-21, 2011, USA
http://www.world-academy-of-science.org/
this could be solved by using dynamic programing (knapsack problem)
On 1/19/2011 12:30 AM, juver++ wrote:
Did you mean absolute difference between two subsets is minimal? --
You received this message because you are subscribed to the Google
Groups Algorithm Geeks group.
To post to this
For RAM question I guess it's answer : A
see -:
http://www.computermemoryupgrade.net/memory-influence-on-performance.html
On Mon, Jan 17, 2011 at 12:59 PM, Algoose chase harishp...@gmail.comwrote:
Pipeline : Choice B : 165 ( this pipeline wastes 20 ns between last 2
stages for each item )
Does anyone has solution to Operating System by Galvin or by William
Stallings ??
--
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
36 matches
Mail list logo