singly linked list
On Wed, Nov 21, 2012 at 8:21 PM, shady sinv...@gmail.com wrote:
which data structure among the follow has fastest sequential access ?
i) vector
ii) Singly linked list
iii) Doubly linked list
it won't be doubly linked list as it involves more pointer manipulations
is going to take O(nlogn) complexity.
Kindly share an alternative algorithm if you find one with lower
complexity.
Vishal
On Wed, Nov 7, 2012 at 7:43 PM, Arun Kindra reserve4placem...@gmail.comwrote:
Given an unsorted array, how to divide them into two equal arrays whose
difference of sum
this in the same array itself i guess but you have to do some
kind of shifting.
by doing this for all the elements and dividing them into two groups.
I hope this helps.
Vishal
On Fri, Nov 16, 2012 at 9:46 AM, bharat b bagana.bharatku...@gmail.comwrote:
@ vishal : how can u divide an array into 2
then it goes for or and increments the k variable and then k = 7
then it finds that condition k=8 to be true.
now one of the condition in the or is true and it then prints the value of
k as 7
hope this helps u.
Vishal Chaudhary
2012/11/6 Anil Sharma anilsharmau...@gmail.com
main()
{
int
and check whether the left child is less
than the root and root is smaller than the right node.
Warm Regards
Vishal Chaudhary
BE(Hons) Computer Science and Engineering
BITS Pilani
On Tue, Nov 6, 2012 at 12:34 AM, shady sinv...@gmail.com wrote:
Hi,
Can we check this by just doing an inorder
.
Thanks
Kumar Vishal
On Wed, Oct 10, 2012 at 2:16 AM, rahul sharma rahul23111...@gmail.comwrote:
Guys i have read that concept of virtual fxn is not applicable in case of
constructors..I means using virtual function in constructors always call
local function..i wan to read more on this..can
://groups.google.com/group/algogeeks?hl=en.
--
Regards
Kumar Vishal
_
*http://wethecommonpeople.wordpress.com/ *
*h**ttp://kumartechnicalarticles.wordpress.com/http://kumartechnicalarticles.wordpress.com
Because you can always find a positive constant c for which following
inequality hold true.
A(n) = cW(n) i.e. the avg. case time complexity always upper bounded by
worst case time complexity. Which is the definition of Big O.
On Sat, Aug 25, 2012 at 7:11 PM, rahul sharma
You have to discard option d because , according to definition of small o
notation if f(n) =o(g(n)) then for ALL constants c 0 you have f(n)
cg(n). or Lim(n-infinite) f(n)/g(n) = 0.
On Sat, Aug 25, 2012 at 10:24 PM, vishal yadav vishalyada...@gmail.comwrote:
Because you can always find
.
--
Regards
Kumar Vishal
_
*http://wethecommonpeople.wordpress.com/ *
*h**ttp://kumartechnicalarticles.wordpress.com/http://kumartechnicalarticles.wordpress.com/
*
_
--
You received this message because you are subscribed
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.
--
Regards
Kumar Vishal
...@googlegroups.com.
For more options, visit this group at
http://groups.google.com/group/algogeeks?hl=en.
--
Regards
Kumar Vishal
_
*http://wethecommonpeople.wordpress.com/ *
*h**ttp://kumartechnicalarticles.wordpress.com/http
I mean 123 is store as 1,2,3 or 3,2,1
On Tue, Jun 26, 2012 at 6:01 PM, Kumar Vishal kumar...@gmail.com wrote:
MSB is at end or at the last of the array .. ??
On Tue, Jun 26, 2012 at 5:43 PM, saurabh singh saurab...@gmail.comwrote:
^ Does it make any difference?
Saurabh Singh
be able to solve the question
On Tue, Jun 26, 2012 at 1:58 AM, prakash y yprakash@gmail.com wrote:
@Vishal,
If the output should be the total no.of pairs, then i think there are
infinite no.of such pairs. but not sure.
Can someone provide me the link to the actual problem and some analysis
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.
--
Regards
Kumar Vishal
_
*http
We have to find number of Pair(x,y)
which will satisfy the eq:
1/x + 1/y = 1/(n factorial)
for large 0 N 10 ^ 4 N is integer
Its problem from Code Sprint
I tried to solve it by taking LOG but the sol
was very slow , can any one please help
Thanks
Kumar Vishal
--
You received
...@gmail.com wrote:
Few Months back I found the problem
on Code Sprint
1/x + 1/y = 1/N! (N factorial). For large value of N
we have to find the par of (X,Y) which satisfy the equation
my sol was slow ,
can any pleas help me .
Thanks
Kumar Vishal
--
You received this message because
!
On Mon, Jun 25, 2012 at 5:04 PM, Roshan kumar...@gmail.com wrote:
Few Months back I found the problem
on Code Sprint
1/x + 1/y = 1/N! (N factorial). For large value of N
we have to find the par of (X,Y) which satisfy the equation
my sol was slow ,
can any pleas help me .
Thanks
Kumar Vishal
bcaz choosing any vertical will automatically fix the horizontals and
vice verse
(u+r) C r= (u+r) C u
On Sat, Jun 23, 2012 at 1:08 PM, Kumar Vishal kumar...@gmail.com wrote:
Let u and r be the distance to move in the up and right directions.
u=y2-y1 and r=x2-x1.
(u+r) C r
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.
--
Regards
Kumar Vishal
_
*http://wethecommonpeople.wordpress.com/ *
*h**ttp
What I can think
is case is :
10
/ \
6 13
/ \
4 5
/ \ \
6 7 8
/ \ \
9 a b
so from a-b is
a-7-4-2-5-8-b
1- Left Tree then
2- Right Tree
add them
On Sat, Jun 23, 2012 at 3:49 PM, Kumar Vishal kumar...@gmail.com wrote:
What I can think
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.
--
Regards
Kumar Vishal
On Sat, Apr 7, 2012 at 11:24 AM, Dave dave_and_da...@juno.com wrote:
@Ashgoel: Try this:
bool OnesZerosOnes(unsigned int n)
{
if( !(n 1) || !(n = n+1) ) return 0;
n |= n-1;
return !(n (n+1));
}
Here is how it works:
!(n 1) is true if the number has trailing zeros.
If
You can try Operating System Concepts and Principles by Gelvin
On Fri, Oct 7, 2011 at 8:32 PM, Brijesh brijeshupadhyay...@gmail.comwrote:
Yeah...anyone plz tell good book for OS concepts
--
You received this message because you are subscribed to the Google Groups
Algorithm Geeks group.
To
I made a small program with window size k = 2;
int max(int n, int m)
{
if ( n m )
return n;
else
return m;
}
int main()
{
int arr[8]={3,5,1,9,0,4,-1,7};
int i,j;
for (i=0;i!=j i=7;i++)
for (j=0;j!=i j=7; j++)
{
int k =
I executed on linux machine..
I am gettign output
0-1-2-3-4-5-6-7-8 :(
for code
int main()
{
static int i=10;
while(--i0)
{
main();
printf(%d,i);
}
return 0;
}
On Wed, Aug 31, 2011 at 7:48 PM, Abhishek Mallick
abhishek.mallick2...@gmail.com wrote:
The
, vishal jain vishal.l...@gmail.com
wrote:
I executed on linux machine..
I am gettign output
0-1-2-3-4-5-6-7-8 :(
for code
int main()
{
static int i=10;
while(--i0)
{
main();
printf(%d,i);
}
return 0
, Aug 31, 2011 at 7:50 PM, vishal jain vishal.l...@gmail.com
wrote:
I executed on linux machine..
I am gettign output
0-1-2-3-4-5-6-7-8 :(
for code
int main()
{
static int i=10;
while(--i0)
{
main();
printf(%d,i
For 2nd,
Are you looking for this? /lib/modules/kernel_versionbuild/ ?
Or the kernel image? It can be found under /boot/. But that depends
upon the distribution, there is no symbolic link present for kernel
image as far as i know.
On Fri, Jul 29, 2011 at 9:45 AM, rajeev bharshetty
+1 Nikhil
On Thu, Jul 28, 2011 at 4:26 PM, Nikhil Jindal fundoon...@yahoo.co.in wrote:
Generate a random number from 1 to 100.
If it is less than or equal to x, return true, else return false.
This will ensure that ur returning true with x/100 probability.
Cheers
Nikhil Jindal
On Thu, Jul
I am not sure about the first question, but if you use sizeof(main()),
it gives the ans 4.
vishal@ubuntu:~/progs/c\ 09:12:57 PM $ cat alg.c
#includestdio.h
int main()
{
printf(%d\n,sizeof(main()));
return 0;
}
vishal@ubuntu:~/progs/c\ 09:13:00 PM $ gcc alg.c
vishal@ubuntu:~/progs/c\ 09:13
@ rajeev,
vishal@ubuntu:~/progs/c\ 09:25:38 AM $ cat alg.c
#includestdio.h
int main()
{
int *p = (int *)0xff;
*p = 4;
return 0;
}
vishal@ubuntu:~/progs/c\ 09:25:42 AM $ gcc alg.c
vishal@ubuntu:~/progs/c\ 09:25:45 AM $ ./a.out
Segmentation fault
vishal@ubuntu:~/progs/c\ 09
@ankur, i think 1,2 and 2,1 would be same as set theory.. CMMIW.
following is the code..
#include stdio.h
#include stdlib.h
void print_comb(int *a, int len)
{
int tlen = len;
int i, j, k;
for (i=0;i5;i++) {
for (j=i+1; j4;j++) {
anyway, the code i posted is buggy.. doesn't work for k=3.. don't use it :)
On Tue, Jul 26, 2011 at 1:02 PM, Vishal Thanki vishaltha...@gmail.com wrote:
@ankur, i think 1,2 and 2,1 would be same as set theory.. CMMIW.
following is the code..
#include stdio.h
#include stdlib.h
void
Here is the working code..
#include stdio.h
#include stdlib.h
int a[] = {1,2,3,4,5};
#define ARRLEN(a) (sizeof(a)/sizeof(a[0]))
void print_comb(int len)
{
int tlen = len;
int i, j, k;
int al = ARRLEN(a);
for (i = 0; i al; i++) {
for (j=i+len-1;
Hi All,
In my last interview(given few months back), I was asked the following
puzzle..
http://goo.gl/jrnpc
Could you please tell me the solution for the same?
Thanks Regards
Vishal Jain
MNo: +91-9540611889
Tweet @jainvis
Blog @ jainvish.blogspot.com
Success taste better when target achieved
I think Aditi's solution is correct. I was doing the same thing using XOR
function... So basically I was saying to use XOR and interviewer was asking
for something better... I could not find this solution...
Thanks Aditi.
Thanks Regards
Vishal Jain
MNo: +91-9540611889
Tweet @jainvis
Blog
z = x + (-y)
:)
On Tue, Jul 12, 2011 at 10:58 AM, Sunny T sunny.1...@gmail.com wrote:
i would say.. implementing subtraction using division and modulus is more
costly and complicated. bit manipulation is the fastest among all
these techniques.
x=a-b = (a/b)*b + a%b
.here u are
google this question!!
On Fri, Jul 8, 2011 at 11:47 AM, priyanshu priyanshuro...@gmail.com wrote:
How to find the number users connected to the web??
--
You received this message because you are subscribed to the Google Groups
Algorithm Geeks group.
To post to this group, send email to
Off Topic:
Sorry for the diversion, but I was just wondering how easy it has
become to code in languages other than c. Here is the code i wrote for
the above mentioned problem in Python. It takes command line arg as
string. something like
vishal@ubuntu:~/progs/python\ 02:45:07 PM $ cat rev.py
@Navneet, it works with multiple spaces between words.. And here is
the two line solution :)
import sys
print .join((sys.argv[1].split())[::-1])
On Thu, Jul 7, 2011 at 3:12 PM, Navneet Gupta navneetn...@gmail.com wrote:
@Vishal, can you see if your program works well for more than single
yea, expression .join((sys.argv[1].split())[::-1]) will return the string!!
On Thu, Jul 7, 2011 at 3:36 PM, Navneet Gupta navneetn...@gmail.com wrote:
@Vishal,
Don't confuse printing in reverse with actually modifying the actual
string to reverse word order in it :)
On Thu, Jul 7, 2011
#!/usr/bin/python
import sys
string=sys.argv[1]
string= .join((string.split())[::-1])
print string
How does this sound? :P
On Thu, Jul 7, 2011 at 3:43 PM, Vishal Thanki vishaltha...@gmail.com wrote:
yea, expression .join((sys.argv[1].split())[::-1]) will return the
string!!
On Thu, Jul 7
you are overwriting terminating null char!!
On Fri, Jul 8, 2011 at 10:23 AM, rShetty rajeevr...@gmail.com wrote:
#includestdio.h
#includestring.h
int main()
{
char str[]=This is rajeev\n;
char str1[10];
memset(str,'0',4);
printf(%s,str);
memcpy(str1,str,10);
printf(\n this is
memcpy is usually used to copy data structures other than strings. Use
strcpy for copying strings!!
On Fri, Jul 8, 2011 at 11:25 AM, Navneet Gupta navneetn...@gmail.com wrote:
@Vishal, still the array str1 is also 10 bytes only, I know that memcpy
overwrites the null character but not sure
If we only need to print the words in reverse order, strtok+recursion
can help. Following is the code (which also stores the string into
another string, not memory efficient though):
#include stdio.h
#include string.h
#include stdlib.h
char str[] = This is a new world;
char sstr[sizeof(str)];
and in that process, I am overwriting the signature
(which is used by free()), and hence free() call fails. Can you point
out the problem?
Thanks,
Vishal
On Sun, Jul 3, 2011 at 2:12 AM, Gene gene.ress...@gmail.com wrote:
Unfortunately this invokes undefined behavior, so it may not work for
all
+1 @Sankalp
On Tue, Jul 5, 2011 at 5:02 PM, sankalp srivastava
richi.sankalp1...@gmail.com wrote:
A better place to put these types of questions would be www.stackoverflow.com
On Jul 4, 10:45 pm, amit kumar amitthecoo...@gmail.com wrote:
thanx guys...
On Mon, Jul 4, 2011 at 5:11 PM,
because \061 is considered as a single char in ur string..
On Mon, Jul 4, 2011 at 12:52 PM, Sangeeta sangeeta15...@gmail.com wrote:
#Iincludestdio.h
#includestring.h
main()
{
char str[]=S\061AB;
printf(\n%d,strlen(str));
}
output:4
why?
--
You received this message because you are
Don't allocate too much static memory in stack, it will cause
troubles. You are doing int[2000][2000], i.e. 2000*2000*4 bytes of
memory in stack. Use dynamic memory allocation for such large chunk. I
modified your code as below and it doesn't give seg fault.
#includestdio.h
#include malloc.h
Rujin is right, here is the code which compiles..
vishal@ubuntu:~/progs/c\ 11:04:37 AM $ cat alg.c
#includestdio.h
int maxdiff(int arr[]);
int main()
{
int p,arr[]={2,4,1,6,23,4};
p=maxdiff(arr);
printf(\n MAX Diff is \t %d,p);
return 0;
}
int maxdiff(int arr
this may be a reverse race, who comes last will win..
On Mon, Jun 27, 2011 at 6:22 PM, Dave dave_and_da...@juno.com wrote:
Force indain driver finishes second in race. Ferari was next to last.
Dave
On Jun 27, 2:18 am, Lavesh Rawat lavesh.ra...@gmail.com wrote:
*Statement Riddle - 27
this code will only print, it will not store the reverse string.
On Mon, Jun 27, 2011 at 9:53 PM, Kamakshii Aggarwal
kamakshi...@gmail.com wrote:
#include stdio.h
#include stdlib.h
void revers(char *s)
{
if(*s)
{
revers(++s);
s--;
and yes, s will be stored in stack everytime you call the function,
so its a temp variable..
string reverse is a simple logic, just iterate i through 1 to n/2 and
swap the i to n-i
On Mon, Jun 27, 2011 at 10:06 PM, Vishal Thanki vishaltha...@gmail.com wrote:
this code will only print
she got killed because of suffocation :P
On Fri, Jun 24, 2011 at 12:35 PM, Lavesh Rawat lavesh.ra...@gmail.com wrote:
sherlock puzzle Solution - 24 june
A wife and her husband were driving in their car on the highway. All of a
sudden, they ran out of gas. So the husband said to the wife,
Hey all,
I think I am missing something very basic in C, and which is troubling
me. Following code is not compiling for me, can anyone explain why?
vishal@ubuntu:~/progs/c\ 09:07:01 AM $ cat ternary.c
#include stdio.h
#include stdlib.h
int main(int argc, char *argv[])
{
int x = atoi(argv
*argv[])
{
int x = atoi(argv[1]);
int y = 10;
x = (x 10) ? y++: 10;
return x;
}
Wladimir Araujo Tavares
Federal University of Ceará
On Fri, Jun 24, 2011 at 12:40 AM, Vishal Thanki vishaltha...@gmail.com
wrote:
Hey all,
I think I am missing something
Okay, I found the problem i think,
(x 10) ? y++: x = 10 is evaluated as ((x 10) ? y++: x) = 10
which is wrong..
(x 10) ? y++: (x = 10) will work.
On Fri, Jun 24, 2011 at 9:22 AM, Vishal Thanki vishaltha...@gmail.com wrote:
yes, i understand that.. but is there any limitation in ternary
was he driving a bus or tram?
On Wed, Jun 22, 2011 at 12:36 PM, Yameni Dhankar yamenid...@gmail.com wrote:
was he driving an ambulance?
On Wed, Jun 22, 2011 at 12:33 PM, Lavesh Rawat lavesh.ra...@gmail.com
wrote:
A Riddle
A bus driver was heading down a street in Delhi. He went right past
memory leak and memory allocation check, make sure malloc return non-null.
On Wed, Jun 22, 2011 at 7:04 PM, Shachindra A C sachindr...@gmail.com wrote:
@balaji, the memory allocated from the heap using malloc needs to be
released before termination of the program. there should be two additional
of Choosing Jar 2)*(Probability of Choosing Red Ball From
jar 2)
(1/2)*(1) + (1/2)(49/99)
Thanks Regards
Vishal Jain
MNo: +91-9540611889
Tweet @jainvis
Blog @ jainvish.blogspot.com
Success taste better when target achieved is bigger.
P *We have a responsibility to the environment.*
*Before printing
btw, i didn't understand the reason/motive behind this question? was
it some kind of test??
On Sat, Jun 18, 2011 at 11:45 AM, Harshal hc4...@gmail.com wrote:
compiler error?? if the void is replaced by int, ans=155.
On Sat, Jun 18, 2011 at 11:33 AM, Balaji S balaji.ceg...@gmail.com wrote:
Folks,
This question was asked during a screening process of a product based
company. Please answer.
http://exploreriddles.blogspot.com/2011/06/interview-questions-puzzle.html
Thanks Regards
Vishal Jain
Success taste better when target achieved is bigger.
P *We have a responsibility
@ Harshal, you are absolutely right. Again, this kind of code is
highly discouraged when used in real life projects. And there is no
need to go into details of how to evaluate such expressions, which are
not complying to standards.
On Wed, Jun 15, 2011 at 10:49 AM, Harshal hc4...@gmail.com wrote:
In 1st program, 2nd printf requires one more argument. And basically
%a is used for printing a double value in hex. see man 3 printf.
On Sat, Jun 11, 2011 at 5:29 PM, nicks crazy.logic.k...@gmail.com wrote:
Hello friends..plz help me in understanding the following C Output
first one is --
Following declaration makes the x as a volatile pointer to an integer.
int *volatile x;
But what does following means?
int **volatile x;
~Vishal
--
You received this message because you are subscribed to the Google Groups
Algorithm Geeks group.
To post to this group, send email to algogeeks
Usually it is a bad practice to increment the pointer. Rather, one
should use the indexing variable to dereference the pointer at some
index. One more bug in your code was, you are allocating the space for
only 3 ints for p and storing 4 ints. Here is the code with some
modification.
#include
http://www.yolinux.com/TUTORIALS/GDB-Commands.html
this may help
On Sat, Jun 4, 2011 at 11:57 PM, nitish goyal nitishgoy...@gmail.com wrote:
@ saurabh singh
thanks
On Sat, Jun 4, 2011 at 11:44 PM, saurabh singh saurabh.n...@gmail.com
wrote:
Do man gdb
On Sat, Jun 4, 2011 at 11:20 PM,
can use fork() also..
On Fri, Jun 3, 2011 at 11:57 AM, anand karthik
anandkarthik@gmail.com wrote:
(!printf(Hello))
On Jun 3, 2011 11:52 AM, Arpit Mittal mrmittalro...@gmail.com wrote:
Please help me in this question.
What's the condition so that the following code prints both
vishal@ubuntu:~/progs/c\ 12:11:53 PM $ cat fork.c
#include stdio.h
#include stdlib.h
int main()
{
if (fork()) {
printf(hello );
} else {
printf(world\n);
}
return 0;
}
vishal@ubuntu:~/progs/c\ 12:11:56 PM $ gcc fork.c
vishal@ubuntu
@sachindra, @naveen,
this was just a plain trick to execute if and else block. i agree
with your concerns :)
2011/6/3 Vιиodh vinodh...@gmail.com:
@vishal:
can u explain the fork() solution??
On Fri, Jun 3, 2011 at 12:16 PM, Shachindra A C sachindr...@gmail.com
wrote:
There can be some
on console tty's driver takes whole line and output it
at once.
On Fri, Jun 3, 2011 at 12:40 PM, Vishal Thanki
vishaltha...@gmail.com
wrote:
@sachindra, @naveen,
this was just a plain trick to execute if and else block. i
agree
with your concerns :)
2011/6/3 Vιиodh vinodh
you may want to read: http://c-faq.com/expr/seqpoints.html
On Wed, Jun 1, 2011 at 5:19 PM, himanshu kansal
himanshukansal...@gmail.com wrote:
a=++b*++b;
if b=3 initially, then a is coming out to be 25.why
--
You received this message because you are subscribed to the Google Groups
#include stdio.h
int main()
{
int a[8] = {1,0,1,1,0,0,1,1};
int b[8] = {1,0,1,1,0,0,1,1};
int c[9] = {0};
int size = sizeof(a)/sizeof(a[0]);
int i;
int carry = 0;
for (i = size-1; i = 0; i--) {
if (a[i] b[i]) {
6785 ...
Now merge the numbers based on their actual value.
987976785..
I have not testing this entirely, but after seeing solution(Multiplying by
10) at top, I though this might work better.
Thanks Regards
Vishal Jain
MNo: +91-9540611889
Tweet @jainvis
Blog
Hi Saurabh,
Can you try it for 10? Could not really understand, what are you gonna
communicate?
10 = 2*5 (2^2 + 1^2 )*(1*2 + 1^2)... If with this logic you are saying 10 is
prime then all numbers divisible by 5 should be prime.
Could you elaborate your answer more?
Thanks Regards
Vishal Jain
will
evaluate to false.
I may be wrong... plz help.
On May 28, 9:15 pm, Vishal Thanki vishaltha...@gmail.com wrote:
here is the code..
#define bi (i)
#define bj (GRID_SIZE+j)
#define bk (int)((GRID_SIZE*2)+(glb_sqrt*(i/glb_sqrt)+(j/glb_sqrt)))
/*glb_sqrt should be the square root of grid_size (i.e
will always
evaluate to false.
same thing will happen for every value in the matrix because the
corresponding bit has been set earlier.
so how is ur verification function working???
On May 29, 3:35 pm, Vishal Thanki vishaltha...@gmail.com wrote:
yes, you are right. bitmap will be filled
during the loop when i==5 and j==4, the if condition will always
evaluate to false.
same thing will happen for every value in the matrix because the
corresponding bit has been set earlier.
so how is ur verification function working???
On May 29, 3:35 pm, Vishal Thanki vishaltha...@gmail.com
a 0.08f will make it compare to float. by default 0.08 is
considered as double.
On Sun, May 29, 2011 at 9:51 PM, Ankit Agarwal ankitgeniu...@gmail.com wrote:
#includestdio.h
int main(void)
{
float a=0.08;
if(a0.08)
printf(Hello\n);
else
printf(Hii\n);
you may want to check how the floats and doubles are stored into
memory using ieee notation.
i tried to print 0.08 and 0.08f in hex format and got the following result.
vishal@ubuntu:~/progs/c\ 10:03:56 AM $ cat fl.c
#include stdio.h
int main()
{
float f=0.08;
if (f 0.08f
what about using a hash function?
On Mon, May 30, 2011 at 10:18 AM, ross jagadish1...@gmail.com wrote:
Given a matrix, you need to find the number of blocks in it.
A block has the same numbers.
EG:
1 1 3
1 2 3
2 2 4
has 4 blocks namely,
1 1
1
2
2 2
3
3
4
1 2 3
4 5 6
7 8 9
not sure what will be the
most efficient data structure to implement this in c/c++.
Vishal
On Mon, May 30, 2011 at 10:31 AM, ross jagadish1...@gmail.com wrote:
@vishal
Hi,
I do not get you.
Can you please elaborate a little more how you ll use hash?
On May 30, 8:50 am, Vishal Thanki
@anshu, i got you. my bad!!
On Mon, May 30, 2011 at 10:49 AM, anshu mishra
anshumishra6...@gmail.com wrote:
@vishal ur sol wil give wrong answer for this
1 1 2
1 3 1
2 3 4
answer should be 6 but ur sol wil give 4.
--
You received this message because you are subscribed to the Google
here is the code..
#define bi (i)
#define bj (GRID_SIZE+j)
#define bk (int)((GRID_SIZE*2)+(glb_sqrt*(i/glb_sqrt)+(j/glb_sqrt)))
/*glb_sqrt should be the square root of grid_size (i.e. 3 if its a 9x9
sudoku). */
/* #define bk (int)((GRID_SIZE*2)+(5*(i/5)+(j/5))) */
/*
* This function will
];
}
}
}
}
Need not to mention that marix[][] is the 2-D array to represent sudoku grid.
On Sat, May 28, 2011 at 9:45 PM, Vishal Thanki vishaltha...@gmail.com wrote:
here is the code..
#define bi (i)
#define bj (GRID_SIZE+j)
#define bk (int)((GRID_SIZE*2)+(glb_sqrt*(i/glb_sqrt)+(j/glb_sqrt
Hello,
*CodeFest'11* http://codefest.org.in/, the annual online international
coding festival of Computer Engineering Society IT-BHU, presents
Manthanhttp://codefest.org.in/event.php?name=manthan-
the *algorithm intensive* programming contest.
The contest aims to provide a platform for
Hello ,
We are delighted to inform you that *Codefest
'11*http://www.itbhu.ac.in/codefest/,
the *annual International online coding festival* of *Computer Engineering
Society, IT-BHU*, has been unveiled. CodeFest is a unique fest wherein
concepts of mathematics, logic, artificial intelligence,
Hello,
We are delighted to inform you that
*Codefest'11*http://www.itbhu.ac.in/codefest/,
the *annual International online coding festival* of *Computer Engineering
Society, IT-BHU*, has been unveiled. CodeFest is a unique fest wherein
concepts of mathematics, logic, artificial
Hello,
We are delighted to inform you that
*Codefest'11*http://www.itbhu.ac.in/codefest/,
the *annual International online coding festival* of *Computer Engineering
Society, IT-BHU*, has been unveiled. CodeFest is a unique fest wherein
concepts of mathematics, logic, artificial intelligence,
@sourabh,
In addition to your solution, If there is any cycle(loop) exist in the link
list your algo will fail.
To solve this problem first detect this cycle if there is any and count the
element in the cycle, and then you can do the mathematics.
On Thu, Jan 6, 2011 at 6:51 PM, sourabh jakhar
@aditya,
Who said it's a Y shaped structure, It can very well has a cycle.
Assume the case when the last node is not pointing to NULL but to a node in
the list.
On Thu, Jan 6, 2011 at 7:45 PM, ADITYA KUMAR aditya...@gmail.com wrote:
@vishal
saurabh is right
its merging at only one point its
@juver, ofcourse , and that's not a big deal.
On Wed, Dec 29, 2010 at 5:11 PM, juver++ avpostni...@gmail.com wrote:
Yes, it's true. But we should process DP in the following order not to take
one element more than once.
--
You received this message because you are subscribed to the Google
] = count[i-1][j] if P(i-1,j) ==1
count[i][j] = count[i-1][j-a[i]] if P(i-1,j-a[i]) ==1
else count[i][j] = 0
On Thu, Dec 30, 2010 at 11:42 AM, vishal raja vishal.ge...@gmail.comwrote:
yeah, My bad.
Missed that.
On Wed, Dec 29, 2010 at 10:52 PM, Wladimir
There were 20 green eyed people and they will commit suicide on 20th day
altogether.
See, There is atleast one green-eyed man.
So let's take the case if there was only one gree-eyed man.
than that man could've seen the colour of all other blued-eyed people and
commit suicide on the very first day.
add up all the elements in array A say sumA and array B say sumB ,substract
the sumA from sumB... You'll get the element.
On Tue, Sep 21, 2010 at 5:36 AM, Anand anandut2...@gmail.com wrote:
Two unsorted arrays are given A[n] and B[n+1]. Array A contains n integers
and B contains n+1 integers
take out that one A pill that's there in the jar. take the half of all the
four pills, that's how u'll make sure that u've had 1 of 'A' and 1 of 'B'
pill.
On Tue, Sep 14, 2010 at 2:52 PM, bittu shashank7andr...@gmail.com wrote:
You are on a strict medical regimen that requires you to take two
.
To unsubscribe from this group, send email to
algogeeks+unsubscr...@googlegroups.comalgogeeks%2bunsubscr...@googlegroups.com
.
For more options, visit this group at
http://groups.google.com/group/algogeeks?hl=en.
--
Kumar Vishal
StAy HunGrY , StAy fOOlisH
, visit this group at
http://groups.google.com/group/algogeeks?hl=en.
--
Kumar Vishal
StAy HunGrY , StAy fOOlisH
Contact No:- 09560193839
--
You received this message because you are subscribed to the Google Groups
Algorithm Geeks group
Can we just not post the code here for debugging? This group more related to
algorithms than implementations. If your code is not working, use debugger.
On Sat, Feb 23, 2008 at 6:22 AM, monty 1987 [EMAIL PROTECTED] wrote:
Find out why this program is not working which converts list
1 - 100 of 122 matches
Mail list logo