Hey Arun, IIya,
the GPUs are faster because of
1. designed for graphics processing, which involves a lot of matrix
processing capabilities , simple example transformation of matrices in
to various view (projection, model and viewport , some times needed
even in real time) so these computation
Sorry for lot of typos
On Mon, Apr 9, 2012 at 1:53 PM, Varun Nagpal varun.nagp...@gmail.comwrote:
GP programming on GPU is useful for those algorithms which are
computationally intensive, can be paralleled with least overheads,
granularity of per thread computations is not big, less+similar
find the sum of all even nos. in the fibbonacci series upto 100
it means upto when my term in fibonici is 100 stop...???ok?
On Mon, Oct 3, 2011 at 8:06 AM, rahul sharma rahul23111...@gmail.comwrote:
guys if i have
Print the sum of the even terms occuring in Fibbonaci (till 1000 terms)
@rahul if u have to find first 100 even fibonacci term sum
the u have to simply find the t2n+1 term -1
--
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
ie, the main function exits..
--
Regards n Luv
Saurabh Badhai
--
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
In c++ we have default copy constructor ,which is called when we use
statement like e2=e;ie when object are of same class type.
On Aug 28, 3:29 pm, ravi maggon maggonr...@gmail.com wrote:
Hi
Can you explain the below mentioned code. As far as I know we need to
overload = operator in order to
c++ provides a few default member functions for your class if you don't
declare them urself, this includes copy constructor assignment(=)
operator.
In your program,
emp e={xyz,21}; // the default copy constructor is invoked
e2=e; // here the default assignment operator is invoked
On Sun, Aug
@all: thanks
On Sun, Aug 28, 2011 at 4:55 PM, rahul vatsa vatsa.ra...@gmail.com wrote:
c++ provides a few default member functions for your class if you don't
declare them urself, this includes copy constructor assignment(=)
operator.
In your program,
emp e={xyz,21}; // the default copy
If you are working in C++, stl has a vector container class which will
do this. Otherwise, declare an integer pointer in the struct and use
malloc to allocate memory for it. Then you can use it like an array.
Don
On Aug 23, 11:51 pm, Arun Vishwanathan aaron.nar...@gmail.com wrote:
say that you
See if we use dynamic memory allocation then still the size of pointer will
be 4 bytes only
Mean that int* pointer still have the size equals to pointer ... malloc only
returns new alloted memory which is now only *pointed *by that pointer
check this out :- http://www.ideone.com/20ayq
On
Yes, the memory provided by malloc will not be in the structure. Only
the pointer to that memory will be in the structure. The size of a
struct is defined at compile time, so it can't be dynamically sized at
run time.
struct junk
{
int size;
int *data;
};
Somewhere in the code:
struct junk
thanks guys!
On Wed, Aug 24, 2011 at 6:37 PM, Don dondod...@gmail.com wrote:
Yes, the memory provided by malloc will not be in the structure. Only
the pointer to that memory will be in the structure. The size of a
struct is defined at compile time, so it can't be dynamically sized at
run
static_cast does not do run time type checking. That's why base
class pointer can be changed to drived class though it actually is a
base class pointer. Now its a drived class pointer, you can call
drived class functions. If you use dynamic_cast instead of
static_cast, it will throw a bad cast
Hi Amit,
Thanks for your reply.
I digged out google and found out that this kind of conversion(downcasting
from base class to derived class) can lead to unexpected behaviour. However,
I fail to understand how the print function was actually called inspite of
it not being in the base class. I
Is it right??
declare an array of pointers like, int *func[N];
and since they are pointers to functions, modify above as, int
(*func[N])();
--
You received this message because you are subscribed to the Google Groups
Algorithm Geeks group.
To view this discussion on the web visit
yup its correct...
--
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
If the function takes in an int argument, then is it modified to
int (*func[N]) (int); ?
On Sun, Jul 31, 2011 at 2:56 PM, ankit sambyal ankitsamb...@gmail.comwrote:
yup its correct...
--
You received this message because you are subscribed to the Google Groups
Algorithm Geeks group.
To
@Nikhil
yes.
On Sun, Jul 31, 2011 at 3:02 PM, Nikhil Gupta nikhilgupta2...@gmail.comwrote:
If the function takes in an int argument, then is it modified to
int (*func[N]) (int); ?
On Sun, Jul 31, 2011 at 2:56 PM, ankit sambyal ankitsamb...@gmail.comwrote:
yup its correct...
--
You
take a BST whose node has an element of frequency .and another array
which will store order of elements.
for each array element search BST if node already exists increase the
freq count ..other wise add that element in the order array we took
and insert new node in BST.
now , scan the order
any specific reason fr maintaining a BST...can we simply have 2 more
arrays...one dat keeps order and the oder that keeps count
correspondingly...
is a BST more efficient than an array??
On Sun, Jul 31, 2011 at 12:43 AM, nivedita arora
vivaciousnived...@gmail.com wrote:
take a BST whose node
nivedita: wts the use to maintaining BST.. if the same purpose can be
fulfilled by an array ..
but this can be a good method if the range of numbers is pretty large.. den
making a hash count can be difficult..
On Sun, Jul 31, 2011 at 12:43 AM, nivedita arora
vivaciousnived...@gmail.com wrote:
maintaining the bst of n element in worst case will take n square time
complexity ..do we have a better solution for worst case
On Sun, Jul 31, 2011 at 12:53 AM, sukhmeet singh sukhmeet2...@gmail.comwrote:
nivedita: wts the use to maintaining BST.. if the same purpose can be
fulfilled by an
i tried making a program using arrays...bt im getting segmentation
error...can anybody expalin y...
http://ideone.com/bEUUv
On Sun, Jul 31, 2011 at 1:14 AM, nivedita arora vivaciousnived...@gmail.com
wrote:
@rahul- balanced BST can be maintained.to remove worst case !
@sukhmeet- i did not gt
@nivedita:can u do this in o(n) time , i suppose your algorithm takes
0(nlogn) time
On Sun, Jul 31, 2011 at 1:14 AM, nivedita arora vivaciousnived...@gmail.com
wrote:
@rahul- balanced BST can be maintained.to remove worst case !
@sukhmeet- i did not gt your method completely ..u are trying to
Create a balance BST.
Maintain counter. Whenever You hit duplicate increase the counter while
inserting.
O(nlogn) for creating it and O(N) space.
Now while traverse the array.
If you find the element, then print it acco the counter value. After
printing delete it.
if not found continue traversing.
@neeraj:deleting after printing will adds to complexity..
On Sun, Jul 31, 2011 at 1:34 AM, Neeraj Gupta neeraj.gupta...@gmail.comwrote:
Create a balance BST.
Maintain counter. Whenever You hit duplicate increase the counter while
inserting.
O(nlogn) for creating it and O(N) space.
Now
ok lets think in terms of hashmap of number and frequency
we definitly have to maintain an order array .
traverse original array , we check if its present in hashmap ..if not
- 1)add it to hashmap and set frequency to 1 2)add it in order array
if yes then increment frequency by 1.
searching
Yes, i agree, it will increase the code complexity only. you can just set
the counter to -ve value only.
On Sun, Jul 31, 2011 at 1:38 AM, Kamakshii Aggarwal
kamakshi...@gmail.comwrote:
@neeraj:deleting after printing will adds to complexity..
On Sun, Jul 31, 2011 at 1:34 AM, Neeraj Gupta
@nivedita :hashing will not work if the range of nos is high
On Sun, Jul 31, 2011 at 1:40 AM, nivedita arora vivaciousnived...@gmail.com
wrote:
ok lets think in terms of hashmap of number and frequency
we definitly have to maintain an order array .
traverse original array , we check if its
that is why i gave BST algo first :)
but rahul wanted me to give O(n) algo
On Jul 31, 1:15 am, Kamakshii Aggarwal kamakshi...@gmail.com wrote:
@nivedita :hashing will not work if the range of nos is high
On Sun, Jul 31, 2011 at 1:40 AM, nivedita arora vivaciousnived...@gmail.com
@nivedita:ohhh :P
On Sun, Jul 31, 2011 at 1:46 AM, nivedita arora vivaciousnived...@gmail.com
wrote:
that is why i gave BST algo first :)
but rahul wanted me to give O(n) algo
On Jul 31, 1:15 am, Kamakshii Aggarwal kamakshi...@gmail.com wrote:
@nivedita :hashing will not work if the range
@ Aditi: you forgot to initialize the arrays and elements.
Thats why the
for(i=0;ik;i++)
for(j=0;jcount[i];j++)
a[p++]=order[i];
was creating some fault while accessing one of the arrays.
I just initialized the arrays and it worked:
http://codepad.org/UO8riyjs
^^ You might want
No. It is unsigned. -- Dave
On Jul 13, 9:28 am, Piyush Kapoor pkjee2...@gmail.com wrote:
Shouldn't the value of 1100 be -64
On Wed, Jul 13, 2011 at 4:53 PM, Anika Jain anika.jai...@gmail.com wrote:
binary equivalent of 5.2 is
101.0011001100110011001100110011(nonterminating)..
Thanks..This link is very useful.
On Jul 10, 11:40 pm, Sandeep Jain sandeep6...@gmail.com wrote:
http://www.parashift.com/c++-faq-lite/virtual-functions.html
Its one of my favorite sites... :)
Regards,
Sandeep Jain
On Mon, Jul 11, 2011 at 12:02 AM, himanshu kansal
ok,thanx
On Jul 4, 12:29 pm, Vishal Thanki vishaltha...@gmail.com wrote:
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;
On Jun 13, 11:43 am, snehi jain snehijai...@gmail.com wrote:
hi,
we try to implement many programs using Recursion
and its said that this is better than iterative procedure.
if i am right then
i cant understand why is it so?
can anybody explain ...
and are there situations when
On 2011-3-2 6:22, rgap wrote:
Hi, does anybody know when/where to use
typedef long long int64;
When 64-bit integer is needed.
and
const long double EPS = 1E-9;
When dealing with floating number comparison.
--
You received this message because you are subscribed to the Google Groups
Hi, does anybody know when/where to use
typedef long long int64;
and
const long double EPS = 1E-9;
--
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
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,
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.
Which book are you studying for OS ?
--
You received this message because you are subscribed to the Google Groups
Algorithm Geeks group.
To post to this group, send email to algoge...@googlegroups.com.
To unsubscribe from this group, send email to
algogeeks+unsubscr...@googlegroups.com.
For
On Jun 12, 1:22 pm, amit amitjaspal...@gmail.com wrote:
OS doubt:
I have read many times that say a 24 KB process enters the Main Memory
selected by the Long Term Scheduler.
But I don't understand what it exactly means.
As far as I know Process consists of ( Code + Data(Static) +
44 matches
Mail list logo