Re: [algogeeks] fastest sequential access

2012-11-23 Thread Atul Singh
i would rather suggest vector for FAST SEQUENTIAL ACCESS
as Vector contain elements in contiguous memory locations...so cache
locality is good in case of it
as in case of Singly Linked List or Doubly Linked List,, cached locality is
not good,, Sequntial access would not be fast in a long run..


On Thu, Nov 22, 2012 at 1:12 PM, atul anand atul.87fri...@gmail.com wrote:

 @shady : as subject says fastest sequential access  , then if i am not
 getting it wrong.we only care of sequential access a value not modifying
 the linked list.
 so i guess double linked list would be helpful
 1) bcozz it can move in both the direction , so if linked list is sorted
 then it would be a great help
 2) if you want to insert element at the end of linked list then if will be
 better than vector
 so i guess it required 1-2 more parameter to decide ,which one to use.

 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
 than singly linked list...

 --




  --






-- 

*ATul Singh** Software Engineer**, Interra Systems*
Mobile : +91-9410826039
www.interrrasystems.com
[image: Facebook] http://www.facebook.com/atulsingh7890 [image:
Twitter]http://www.twitter.com/atulsng
 [image: LinkedIn] http://www.linkedin.com/in/atulsingh7890

-- 




Re: [algogeeks] fastest sequential access

2012-11-23 Thread Atul Singh
@Pralay.. can u give a more detail about non synced data structure

-- 




Re: [algogeeks] Re: Range Checking Efficiently C++

2012-11-02 Thread Atul Singh
@biku look at the conditions
where x is equal to b

when a  x  b
suppose

1  5  5  , it should give FALSE ...

-- 
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: Range Checking Efficiently C++

2012-11-02 Thread Atul Singh
Yours can be used at the situation when

a  x = b , Good one .,

-- 
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: Range Checking Efficiently C++

2012-10-30 Thread Atul Singh
i have attached a file consisting first by comparison and second by XORING
biku,.,. u shuld have a look at 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 to 
algogeeks+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/algogeeks?hl=en.


0   =  0  0   FALSEFROM COMPARISON
0   =  00 FALSE   FROM  XORING

0   =  1  0   FALSEFROM COMPARISON
0   =  10 TRUEFROM  XORING

0   =  2  0   FALSEFROM COMPARISON
0   =  20 TRUEFROM  XORING

0   =  3  0   FALSEFROM COMPARISON
0   =  30 TRUEFROM  XORING

0   =  4  0   FALSEFROM COMPARISON
0   =  40 TRUEFROM  XORING

0   =  5  0   FALSEFROM COMPARISON
0   =  50 TRUEFROM  XORING

0   =  6  0   FALSEFROM COMPARISON
0   =  60 TRUEFROM  XORING

0   =  7  0   FALSEFROM COMPARISON
0   =  70 TRUEFROM  XORING

0   =  8  0   FALSEFROM COMPARISON
0   =  80 TRUEFROM  XORING

0   =  9  0   FALSEFROM COMPARISON
0   =  90 TRUEFROM  XORING


0   =  0  1   TRUE FROM COMPARISON
0   =  01 FALSE   FROM  XORING

0   =  1  1   FALSEFROM COMPARISON
0   =  11 TRUEFROM  XORING

0   =  2  1   FALSEFROM COMPARISON
0   =  21 TRUEFROM  XORING

0   =  3  1   FALSEFROM COMPARISON
0   =  31 TRUEFROM  XORING

0   =  4  1   FALSEFROM COMPARISON
0   =  41 TRUEFROM  XORING

0   =  5  1   FALSEFROM COMPARISON
0   =  51 TRUEFROM  XORING

0   =  6  1   FALSEFROM COMPARISON
0   =  61 TRUEFROM  XORING

0   =  7  1   FALSEFROM COMPARISON
0   =  71 TRUEFROM  XORING

0   =  8  1   FALSEFROM COMPARISON
0   =  81 TRUEFROM  XORING

0   =  9  1   FALSEFROM COMPARISON
0   =  91 TRUEFROM  XORING


0   =  0  2   TRUE FROM COMPARISON
0   =  02 FALSE   FROM  XORING

0   =  1  2   TRUE FROM COMPARISON
0   =  12 TRUEFROM  XORING

0   =  2  2   FALSEFROM COMPARISON
0   =  22 TRUEFROM  XORING

0   =  3  2   FALSEFROM COMPARISON
0   =  32 TRUEFROM  XORING

0   =  4  2   FALSEFROM COMPARISON
0   =  42 TRUEFROM  XORING

0   =  5  2   FALSEFROM COMPARISON
0   =  52 TRUEFROM  XORING

0   =  6  2   FALSEFROM COMPARISON
0   =  62 TRUEFROM  XORING

0   =  7  2   FALSEFROM COMPARISON
0   =  72 TRUEFROM  XORING

0   =  8  2   FALSEFROM COMPARISON
0   =  82 TRUEFROM  XORING

0   =  9  2   FALSEFROM COMPARISON
0   =  92 TRUEFROM  XORING


0   =  0  3   TRUE FROM COMPARISON
0   =  03 

Re: [algogeeks] Re: Range Checking Efficiently C++

2012-10-28 Thread Atul Singh
srry for my wrong typo..

it should be
*
unsinged( x - a )   (unsigned)b  - a*


works  only for positive a and b   a = b

-- 
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] Range Checking Efficiently C++

2012-10-25 Thread Atul Singh
Is there a efficient way to check the range of numbers in C++

Suppose if x is to checked in range a and b both exclusive

ie if ( x  a  x  b )

Is there any efficient way of doing this.

-- 
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: microsoft_c++_qstn

2012-10-05 Thread Atul Singh
May be because when u look at the code.. rect(8) only returns  and 8 is
stored into register but when it returns to rect(4) .it simply ends and
goes to rect(2) which in turn goes to rect(1).

So returned value is taken from that register that is filled with value
returned from it i.e 8.
May be that returning  recursive manner and filling that register is
dependent on compiler to compiler.

-- 

*ATul Singh** *
Mobile : +91-9410826039
[image: Facebook] http://www.facebook.com/atulsingh7890 [image:
Twitter]http://www.twitter.com/atulsng
 [image: LinkedIn] http://www.linkedin.com/in/atulsingh7890

-- 
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]

2012-06-29 Thread Atul Singh
R-value  - Contents of memory location  ( ie value stored in that memory
location )
L-Value  - Name of that memory location

suppose ,  int i=9;   than here* r-value is 9* and* l-value is i* .

Taking *++x++  ..*
As Postfix ( ++ ) is having higher precendence over Prefix( ++ ) so Postfix
will be evaluated first.


then ++x++here   *x++ *generates a temporary and you cant apply  *prefix
++ *on a temporay  ( generated as a result of an r-value expresiion ).
Prefix increment operator requires its operand to be an lvalue ,, and  x++
isnt an l-value ...that's why it would give error, .




-
ATul Singh | Computer Science  Engineering| 2008-12 Batch | NIT Jalandhar
 | 9530739855

-- 
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] Double Linked List Represented With Single Linked List

2012-06-21 Thread Atul Singh
These posts will clear ur questions
http://www.geeksforgeeks.org/archives/12367
http://www.geeksforgeeks.org/archives/12615

-- 
ATul Singh | Computer Science  Engineering| 2008-12 Batch | NIT Jalandhar
 | 9530739855

-- 
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: MS QUESTION_LINKED LIST

2012-03-23 Thread Atul Singh
I couldn't understand the meaning of  *return the pointer to smallest*
Is it that that the pointer of largest node will point to smallest node.



ATul Singh | Final Year  | Computer Science  Engineering | NIT
Jalandhar  | 9530739855
|

-- 
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] Run Length Decoding... inplace

2012-03-19 Thread ATul SIngh
This was a MS question asked recently on Run length Decoding. I was
given
Input- a3b5c3d2

And the output should be  ddcccbaaa

Assuming that the memory given is sufficient to accomodate the whole
string.
And this conversion should be inplace. ie the output string should not
use another array.

-- 
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] Google written test

2012-03-17 Thread Atul Singh
@Ravi...  there should be only one answer as for fibonacci representation
of a number we have to include the part of the fibonacci number just less
than the number then remaining part of the sum is filled by fibonacci
numbers starting from 1

suppose we have to convert 6 into fibonacci representation
then 6 has two sum sets as {1,2,3} or {1,5}

then the fibonacci number just less than 6 is 5 so bit representing 5 is
set then for completing the sum to 6 bit 1 is also set.
so *fibonacci representation of 6 is 1001 .* not 0111


ATul Singh | Final Year  | Computer Science  Engineering | NIT
Jalandhar  | 9530739855
|

-- 
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]

2012-02-07 Thread Atul Singh
1.You can use wget to get the homepage source.
2.Then u can grep the links in it and using cut to get the clear links
associated in that page.
3.Doing that recursively all links can be crawled.


-- 
ATul Singh | Final Year  | Computer Science  Engineering | NIT
Jalandhar  | 9530739855
|

-- 
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] C concept on memory layout

2012-02-07 Thread Atul Singh
I think rahul has given a clear solution i.e why the static variable is not
accessible in main() function because of its scope.
I would like to add one more point in this...that  Static variables may be
initialized in their declarations;

however, the initializers must be constant expressions, and initialization
is done only once at compile time when memory is allocated for the static
variable

-- 
ATul Singh | Final Year  | Computer Science  Engineering | NIT
Jalandhar  | 9530739855
|

-- 
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] Search an element in an Infinite array

2011-10-23 Thread Atul Singh
Do a binary Search between a[2**(k-1)] and a[2**(k)]

just find kth element greater than the item to be searched.



On Mon, Oct 24, 2011 at 12:28 AM, sunny agrawal sunny816.i...@gmail.comwrote:

 hint 1: try to find 2 indexes i, j such that a[i] = K = a[j]


 On Sun, Oct 23, 2011 at 11:23 PM, Ankuj Gupta ankuj2...@gmail.com wrote:

 Given a sorted array of Infinite size, find an element ‘K’ in the
 array without using extra memory in O (lgn) time

 --
 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.




 --
 Sunny Aggrawal
 B.Tech. V year,CSI
 Indian Institute Of Technology,Roorkee


  --
 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.




-- 
ATul Singh | Final Year  | Computer Science  Engineering | NIT Jalandhar

-- 
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.