You are given a array with rows sorted and column sorted. You have to print
entire array in sorted order.
--
With Regards,
*Jalaj Jaiswal* (+919019947895)
Software developer, Cisco Systems
Final Year Undergraduate,
IIIT ALLAHABAD
--
You received this message because you are subscribed to the
Printing in the normal order will print the sorted output. starting from
Value[0][0] to value [m][n].
OR
Please provide a e.g. array which need to be printed if I am wrong.
Thanks Regards,
Rajiv Podar
On Mon, Feb 7, 2011 at 2:13 PM, jalaj jaiswal jalaj.jaiswa...@gmail.comwrote:
You are
here is the counter example.. below every row is sorted and every column is
sorted
0 2 3 4
0 3 4 5
1 4 5 6
2 5 6 7
On Mon, Feb 7, 2011 at 2:17 PM, Rajiv Podar rajeevpo...@gmail.com wrote:
Printing in the normal order will print the sorted output. starting
from Value[0][0] to value [m][n].
@gajendra
i found that its basically combination problem
we have to print all combination of all number in given range that
can compose a given number
Examples:
For n = 1, the program should print following:
1
For n = 2, the program should print following:
1 1
2
For n = 3, the program should
one of the possible methods is to use concept same as EXTRACT-MIN of heaps
do the following steps *m*n *times
1. print a[0][0] ans replace this by a[m-1][n-1]
2. call REORDER(0,0)
in REORDER(i,j) function we perform following operations to make array's all
row's and column's sorted
1.if a[i,j] =
isn't mnlog(mn)(simple quick sorting the entire array) better then
mnlog(m+n)
On Mon, Feb 7, 2011 at 2:46 PM, sunny agrawal sunny816.i...@gmail.comwrote:
one of the possible methods is to use concept same as EXTRACT-MIN of heaps
do the following steps *m*n *times
1. print a[0][0] ans
Hey i m just a newbie To group BTW from MNIT jaipur 3rd yr CS
I just though we should apply merge sortmean merge 2 array into one )
on 1st row 1st column this will be accurate since rows columns r
Sorted) next we move down the diagnol 1 step apply the same merge sort
n so on cant say
for merge sort extra space will be needed
On Mon, Feb 7, 2011 at 3:10 PM, arpit busy in novels
arpitbhatnagarm...@gmail.com wrote:
Hey i m just a newbie To group BTW from MNIT jaipur 3rd yr CS
I just though we should apply merge sortmean merge 2 array into one )
on 1st row 1st column
hmm ya u need an extra K array but i think soln is fast do U
On Mon, Feb 7, 2011 at 3:11 PM, jalaj jaiswal jalaj.jaiswa...@gmail.comwrote:
for merge sort extra space will be needed
On Mon, Feb 7, 2011 at 3:10 PM, arpit busy in novels
arpitbhatnagarm...@gmail.com wrote:
Hey i m just a
You are given a no. of identical balls and a building with N floors.
you know that there is an integer X N such that ball will break if it
is dropped from any floor X or higher but it will remain intact if
dropped from a floor below X.
Given K balls and N floors, what is the minimum no. of ball
given file containing roughly 300 million social security nos. ( 9
digit nos.) find a 9 digit no. that is not in the file. you have
unlimited drive space but only 2 megabytes of RAM at your disposal.
--
You received this message because you are subscribed to the Google Groups
Algorithm Geeks
Read data and store in std::map
and then check for it
Thanks Regards,
Rajiv Podar
On Mon, Feb 7, 2011 at 3:33 PM, snehal jain learner@gmail.com wrote:
given file containing roughly 300 million social security nos. ( 9
digit nos.) find a 9 digit no. that is not in the file. you have
yeh.
Agree with ramkumar.
Simplest solution is to use Stack...
On Sun, Feb 6, 2011 at 8:11 PM, Abhijit K Rao abhijitkrao...@gmail.comwrote:
I could not get it for recursively, but iteratively, I coded a solution. If
anyone knows recursively,
let us know please.
#includestdio.h
void main()
BinarySearch ?
On Mon, Feb 7, 2011 at 3:29 PM, snehal jain learner@gmail.com wrote:
You are given a no. of identical balls and a building with N floors.
you know that there is an integer X N such that ball will break if it
is dropped from any floor X or higher but it will remain intact if
jalaj is right actually the complier produce p[n]=*(p+n);
On Mon, Feb 7, 2011 at 12:34 PM, Rajiv Podar rajeevpo...@gmail.com wrote:
for e.g. u can use operator.
int a = 1;
a = a 1;
a become 2;
Or u cannot use any , |, ^ operations.
Thanks Regards,
Rajiv Podar
On Mon, Feb
How to design a chess board using OOPS ? ?
--
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.
NIRAL:
Division of MCA, Dept of IST of CEG, ANNA UNIVERSITY ,CHENNAI is proud
to present NIRAL- A National Level Technical Symposium on MARCH 4th
2011.
Have you sought for a forum to stage your technical expertise?
Constantly have the urge to go High-funda on others? Here is the
confluence for
yet to test...
will download xcode to compile, not on linux or windows (:
remote case of all both entries in last row or last col needs to be looked..
int ai=1; int bi=0;int aj=0; int bj=1;
int row = 0; int col=0;
printf(%d \n, a[0][0]);
while ((aim)(bjn))
{
if (arr[ai][aj]arr[bi][bj])
@ anand: I didn't understand
in printf, u r evaluating the values frm right to left n thn while printing,
u hv to print the evaluated values, y u r again evaluating the values while
u r printing frm left to right??
as in, u said-
Now it try to display the value from left to right which makes a++
u can merge first two rows and proceed two at time.then slowly merge 4 at a
tym and so on.a recursive algo will do
On Mon, Feb 7, 2011 at 6:25 PM, Ashish Goel ashg...@gmail.com wrote:
yet to test...
will download xcode to compile, not on linux or windows (:
remote case of all both
I guess it will fail for the array, looks like incomplete logic.
4 911 14
5 10 13 16
9 16 18 20
On Feb 7, 5:55 pm, Ashish Goel ashg...@gmail.com wrote:
yet to test...
will download xcode to compile, not on linux or windows (:
remote case of all both entries in last row or last
But then we are not using the other property of the array that it's
columns are sorted
On Feb 7, 6:33 pm, jagannath prasad das jpdasi...@gmail.com wrote:
u can merge first two rows and proceed two at time.then slowly merge 4 at a
tym and so on.a recursive algo will do
On Mon, Feb 7,
p[n] gives address of p+n it does not add..
Best Regards
Ashish Goel
Think positive and find fuel in failure
+919985813081
+919966006652
On Mon, Feb 7, 2011 at 11:47 AM, jalaj jaiswal jalaj.jaiswa...@gmail.comwrote:
try this
let nos be m n
char * p;
p=m;
int sum = (int)p[n] ;
sum is
I would assume that in addition to functional testing through
automation(combination of various fonts,sizes etc) the tenets like
reliability, accessibility, interoperability, security(fuzz testing),
different architectures(amd, intel 32 bit, 64 bit etc), stress(extremely
long file reaching space
i also think the same as 14 and 15
On Mon, Feb 7, 2011 at 6:40 PM, tech rascal techrascal...@gmail.com wrote:
@ anand: I didn't understand
in printf, u r evaluating the values frm right to left n thn while
printing, u hv to print the evaluated values, y u r again evaluating the
values while u
@ spark , hi
i think either a[0,0] or a[n,n] will be the largest element
we need one more step to test which one is biggest then apply my algo:
I just though we should apply merge sortmean merge 2 array into one )
on 1st row 1st column this will be accurate since rows columns r
Sorted)
#includestdio.h
int main()
{
float a=11.202;
if(a11.202)
printf(Hiii!!!\n);
else
printf(Hello!!!\n);
return 0;
}
output: Hiii!!!
why does this output comes???
Ankit Agarwal
--
You received this message because you are subscribed to the Google Groups
try dis :
#includestdio.h
int main()
{
float a=11.202;
if((a-11.202)==0)
printf(Hiii!!!\n);
else
printf(Hello!!!\n);
return 0;
}
you will get :
Hello!!!
On Mon, Feb 7, 2011 at 8:22 PM, ankit agarwal ankitgeniu...@gmail.comwrote:
#includestdio.h
int
But is the bug in the given program
On Mon, Feb 7, 2011 at 8:32 PM, Shalini Sah shalinisah.luv4cod...@gmail.com
wrote:
try dis :
#includestdio.h
int main()
{
float a=11.202;
if((a-11.202)==0)
printf(Hiii!!!\n);
else
printf(Hello!!!\n);
@ashish: tht's true. But that will be the sum of two numbers.
Reason is v store the address in char* so when increment it by other number it
will increment that times, that is the required answer.
Sent from my iPod
On Feb 7, 2011, at 7:14 PM, Ashish Goel ashg...@gmail.com wrote:
p[n] gives
Won't it increment by 2 (or something) and not by 1?
Sent from my BlackBerry
-Original Message-
From: Rajeevpodar rajeevpo...@gmail.com
Sender: algogeeks@googlegroups.com
Date: Mon, 7 Feb 2011 20:41:32
To: algogeeks@googlegroups.comalgogeeks@googlegroups.com
Reply-To:
Float comparison are not recomended in C++ better try the following condition.
If( abs( a- 11.202 ) = 1.e6 )
This will solve your problem.
Sent from my iPod
On Feb 7, 2011, at 8:22 PM, ankit agarwal ankitgeniu...@gmail.com wrote:
#includestdio.h
int main()
{
float a=11.202;
@Ankit: The variable a is a float, while the constant 11.202 is a
double. When the constant 11.202 was rounded to size float in the
assignment, it was (apparently) rounded down. For purposes of the
comparison, a was cast to type double, and the added bits were filled
with zeros. So (double)a
@Shalini: Did you try it, or are you only speculating?
Dave
On Feb 7, 9:02 am, Shalini Sah shalinisah.luv4cod...@gmail.com
wrote:
try dis :
#includestdio.h
int main()
{
float a=11.202;
if((a-11.202)==0)
printf(Hiii!!!\n);
else
printf(Hello!!!\n);
Ok. Just checking.
Sent from my BlackBerry
-Original Message-
From: Rajeevpodar rajeevpo...@gmail.com
Sender: algogeeks@googlegroups.com
Date: Mon, 7 Feb 2011 20:51:33
To: algogeeks@googlegroups.comalgogeeks@googlegroups.com
Reply-To: algogeeks@googlegroups.com
Subject: Re: [algogeeks]
@Rajeevpodar: Float comparisons are fine, if you do them correctly. In
this case, using 11.202e0 instead of 11.202 is correct. And, of
course, your comparison is not an one-sided inequality test, but a
fuzzy equality test.
Dave
On Feb 7, 9:14 am, Rajeevpodar rajeevpo...@gmail.com wrote:
Float
i tried it n its running
On Mon, Feb 7, 2011 at 8:53 PM, Dave dave_and_da...@juno.com wrote:
@Shalini: Did you try it, or are you only speculating?
Dave
On Feb 7, 9:02 am, Shalini Sah shalinisah.luv4cod...@gmail.com
wrote:
try dis :
#includestdio.h
int main()
{
float
@Ankit: Yes. The bug is that the constant in the comparison should
have been written 11.202e0.
Dave
On Feb 7, 9:05 am, ankit agarwal ankitgeniu...@gmail.com wrote:
But is the bug in the given program
On Mon, Feb 7, 2011 at 8:32 PM, Shalini Sah shalinisah.luv4cod...@gmail.com
wrote:
Thanq ol...
On Mon, Feb 7, 2011 at 8:56 PM, Dave dave_and_da...@juno.com wrote:
@Ankit: Yes. The bug is that the constant in the comparison should
have been written 11.202e0.
Dave
On Feb 7, 9:05 am, ankit agarwal ankitgeniu...@gmail.com wrote:
But is the bug in the given program
Can anyone tell me a nice resource to study java online
also please list some of the most popular books to study the language
that has a lucid and detailed explanation of the libraries and
packages of the java programmiing language needed for competitive
programming please help
--
You received
Have a look at this earlier discussion where the problem was to find for
array[i], the next nearest larger element than array[i] in the remaining
array.
https://groups.google.com/d/topic/algogeeks/A51KGsPMtAE/discussion
Look at the solution suggested by balaji. Modifying it shall solve your
Are all the integers positive only ?
On 2/7/11, jalaj jaiswal jalaj.jaiswa...@gmail.com wrote:
you are given a bst where each node has a int value , parent pointer , and
left and right pointers , write a function to find a path with a given sum
value. Path can go from left subtree tree ,
For more of these tricks one can see the first 10 lectures
from{exclude 1st one}
http://see.stanford.edu/see/lecturelist.aspx?coll=2d712634-2bf1-4b55-9a3a-ca9d470755ee
On 2/7/11, ranjane ranjane...@gmail.com wrote:
thank u jalaj
On Feb 6, 10:03 pm, jalaj jaiswal jalaj.jaiswa...@gmail.com
top of mind thoughts.
Chess layout one array of objects.
Methods:
- get_content()
- set_postion()
- is_check()
etc.
generic class each chessmen:
sub class type of chessmen(knight,rook etc)
methods:
next_moves()
make_move()
is_alive()
etc.
On Mon, Feb 7, 2011 at 4:12 PM, Manmeet
Hello ,
Our college LAN is infected with virus . If you have received any
spam mails from my mail account , sorry for the inconvenience caused .
-Thanks Regards
K.Abhinav Raghunandan
Department of Computer Science Engg,
IIT Madras
--
You received this message because you are
Well, MS is way better in this regard. They talk so politely and take only a
couple of weeks to send a message for further interview :-)
On Sun, Feb 6, 2011 at 9:15 PM, shubham singh
shubhamsisodia0...@gmail.comwrote:
i applied for intern and get reply within a month.
--
You received this
jalaj back to algogeeks..
On Mon, Feb 7, 2011 at 6:09 PM, rahul rai raikra...@gmail.com wrote:
Are all the integers positive only ?
On 2/7/11, jalaj jaiswal jalaj.jaiswa...@gmail.com wrote:
you are given a bst where each node has a int value , parent pointer ,
and
left and right pointers
Hi
You can try Head first java to start with. Also SCJP should be good
enough to start with.
If you really want to learn java in depth..den try reading JVM internals by
Bill Venners.
Other books -
1.effective java
2.java puzzlers both by josh bloch
Regards
badri
--
You received this
http://www.artima.com/insidejvm/ed2/jvm.html
I strongly recommend you to get a personal copy and study.
http://java.sun.com/docs/books/jls/third_edition/html/j3TOC.html
http://java.sun.com/docs/books/jvms/second_edition/html/VMSpecTOC.doc.html
--
You received this message because you are
@Jalaj: The results depend on the endianness of the addressing
scheme on your hardware. (See http://en.wikipedia.org/wiki/Endianness.)
The language standard does not specify a required endianness. You must
be using a little-endian hardware, but the results would be different
on a big-endian
@ rahul .. you can give the solution for both cases .. :-o
@ ashish :P
On Mon, Feb 7, 2011 at 9:23 PM, ashish agarwal ashish.cooldude...@gmail.com
wrote:
jalaj back to algogeeks..
On Mon, Feb 7, 2011 at 6:09 PM, rahul rai raikra...@gmail.com wrote:
Are all the integers positive only ?
@ dave .. you r correct :)
On Mon, Feb 7, 2011 at 9:41 PM, Dave dave_and_da...@juno.com wrote:
@Jalaj: The results depend on the endianness of the addressing
scheme on your hardware. (See http://en.wikipedia.org/wiki/Endianness.)
The language standard does not specify a required endianness.
but gcc compiler is giving error saying- can't convert int* to char* in
assignment..so hw r u getting 566 as answer??
( I am using codeblocks on ubuntu )
On Mon, Feb 7, 2011 at 10:10 PM, jalaj jaiswal jalaj.jaiswa...@gmail.comwrote:
@ dave .. you r correct :)
On Mon, Feb 7, 2011 at 9:41
hey jalaj ,
i just wanna say can be 2 test cases
2 4 8
6 7 9
7 8 10 where a[n,n] is big
or 12 11 10
987
654where a[0,0] is biggest
if u didnt consider increment
this error will be given by g++ compiler , i guess.. i also got d same
On Mon, Feb 7, 2011 at 10:20 PM, tech rascal techrascal...@gmail.comwrote:
but gcc compiler is giving error saying- can't convert int* to char* in
assignment..so hw r u getting 566 as answer??
( I am using codeblocks
I would like to have pseudo for this .
On Mon, Feb 7, 2011 at 11:12 AM, jalaj jaiswal jalaj.jaiswa...@gmail.comwrote:
A very common interview question
let the array be from 0 to 2n-1
now,
every element of array has its initial position and final position.. start
from beginning
if the
no, its GNU gcc compiler
On Mon, Feb 7, 2011 at 10:27 PM, jalaj jaiswal jalaj.jaiswa...@gmail.comwrote:
this error will be given by g++ compiler , i guess.. i also got d same
On Mon, Feb 7, 2011 at 10:20 PM, tech rascal techrascal...@gmail.comwrote:
but gcc compiler is giving error saying-
The classical coin-changing problem can be stated as follow:
Given an integer set C={c_1, c_2, ... c_n} where c_1=1 and c_i c_{i
+1}, and an positive integer M,
find the minimum of \sum_{i=1}^n x_i, where all x_i's are non-negative
integers and subject to \sum_{i=1}^n x_i c_i = M
And it is well
algo in more detail :-o
if the array is numbered from 0..(2n-1)
i= initial position of int/char
f= final position of int/char
if (i (2n-1)/2) #for integer
f = i+i
else #for char
f = i - ((2n-1)-i)
so iterate through the array in the following way
choose first element
determine it final
can you explain what are you doing ... take this array for example and tell
how are you printing the sorted output
0 1 2 3
2 2 3 4
3 3 4 5
4 5 6 7
On Mon, Feb 7, 2011 at 10:27 PM, arpit busy in novels
arpitbhatnagarm...@gmail.com wrote:
hey jalaj ,
i just wanna say can be 2 test cases
@above, if initial position=final position or the final position was
empty,then choose the next element(element next to the initial position) as
current element
How do you guarantee when you move to the next element, the next element is
not already processed? Otherwise, you will double process on
i m taking 1st array as 7 6 5 4 2nd as 7 5 43and merging them
by merge sort so k[]={7,7,6,5,5,4,4,3}
then 1st as 4 3 3 2nd as 4 3 2
l[]=4,4,3,3,3,2
den
m=[2,2,1]
finally merging k , l , m
after a bit analysis i stick strongly to my soln :
0 1 2 3since element of last row column will
always be greater than rest of array
2 2 3 4
3 3 4 5
4 5 6 7 take 7654 as 1st7543 as 2nd merge them
as k[]
array reduced to
0 1 2
2 2 3
3
The greedy algorithm always gives the optimal solution if:
c_1 = 1, and
c_i = 2*c_{i-1}, i = 2, 3, ..., n.
Dave
On Feb 7, 11:35 am, ziyuang ziyu...@gmail.com wrote:
The classical coin-changing problem can be stated as follow:
Given an integer set C={c_1, c_2, ... c_n} where c_1=1 and c_i c_{i
Thank you. But can you offer your proof?
On Feb 8, 3:02 am, Dave dave_and_da...@juno.com wrote:
The greedy algorithm always gives the optimal solution if:
c_1 = 1, and
c_i = 2*c_{i-1}, i = 2, 3, ..., n.
Dave
On Feb 7, 11:35 am, ziyuang ziyu...@gmail.com wrote:
The classical
Algo :
Number of social security numbers possible = 9x10^8 .
300 million = 3x10^8
In these social security numbers duplicates may be present .
1 Take 9 counters and count the social security numbers starting with
1,2,3,...9
2 At the end of 1st traversal , we will know the 1st digit of a
*please send matching profile to st...@dwlabs.com*
*Need ETL Architect/Architect*
Location: Westborough MA
Duration:3-6 Months
Skills:
Informatica Architect/Developer
Informatica 8.6 experience
8 Years minimum with Informatica
Strong SQL Server
New Developement experience
Writing Test
*please send matching profile to st...@dwlabs.com*
*Need Java Developer*
Location: West Chester, PA
Duration: 6 months extendable
SKILLS REQUIRED
Design and Develop enterprise applications using Agile methodology Develop
detailed designs using Object-Oriented Methodology RSA experience is a
منتجات لجعل الحياة الزوجية اكثر سعادة و متعة و تجدد
موقع اعجبني به منتجات للازواج و العرسان
فيه لا نجريات و العاب و عطور و كريمات ومقويات ورمانسيات ومنشطات و
مستحضرات
فعلا موقع ممتاز احببت انقله لكم وارجو يعجبكم
اسم الموقع
قطار الحب ايطاليا
هذا رابط الموقع
http://www.lovetrain1.com/
في صورة ما
help to install-
Fedora O S by 4 gb pendrive
--
Thanks Regards...*
*Sudhir Mishra
*IT 3rd YEAR*
*Motilal Nehru National institute Of Technology-ALLAHABAD.
*
--
You received this message because you are subscribed to the Google Groups
Algorithm Geeks group.
To post to this group,
Treat the 2 megabytes of RAM as 1 million short integers (16 bits).
Read through the file and count the number of occurrences of the SSNs
divided by 1000, i.e., the first 6 digits of each number. If the
numbers are distinct, there can't be more than 1000 in each bin, so
you can cap the counters at
Take a look at this paper:
http://arxiv.org/PS_cache/arxiv/pdf/0809/0809.0400v1.pdf
Dave
On Feb 7, 1:51 pm, ziyuang ziyu...@gmail.com wrote:
Thank you. But can you offer your proof?
On Feb 8, 3:02 am, Dave dave_and_da...@juno.com wrote:
The greedy algorithm always gives the optimal
Any solution for this
On Fri, Jan 21, 2011 at 1:56 PM, Gaurav_K_Singh gaurav.bhu1...@gmail.comwrote:
*
Place N number from 1 to N, in 2N positions in such a way so that there
are
Exactly “a” number of cells between two placed locations of number “a”.
Write a program to display numbers
I tried implementing the problem.
Working code is:
#include stdio.h
void print_arr(int* arr, int len)
{
int i;
printf(\n Array is \n);
for (i = 0; i len; i++)
{
printf(%d , arr[i]);
}
printf(\n);
}
int get_right_index(int i, int len)
{
if (i len/2) {
I need help regarding the codechef flip coin problem .
I am trying a code with O(n) time and it is giving TLE .
Couldn't figure out a better solution.
http://www.codechef.com/problems/FLIPCOIN/
Thanks for help .
--
Thanks and Regards ,
Gaurav Saxena
--
You received this message because you
i think your solution will be O(n) for each query
so it will be O(Q*N), that will surely timeout
read about Range Trees, segment trees from wiki or CLRS
On Tue, Feb 8, 2011 at 1:01 PM, Gaurav Saxena grvsaxena...@gmail.comwrote:
I need help regarding the codechef flip coin problem .
I am trying
76 matches
Mail list logo