prefered language for datastructures

M

mohi

hello every one ,
i know this is a c++ forum ,but as i cudn't get any datastructures
forum ..iam
posting here :
can anyone tell me which is the best language to be used for
implementation of datastructures
by best i mean speed of operation :
and if given a choise that someone knows both c and c++ which one will
be convinent ang faster for implementimg data structures??

thank you
mohan gupta
 
N

Nick Keighley

i know this is a c++ forum ,but as i cudn't get any datastructures
forum ..iam posting here :

you could try comp.lang.programming for
this sort of general discussion.

can anyone tell me which is the best language to be used for
implementation of datastructures
by best i mean speed of operation :

an odd definition of "best". C++ was designed with a principal
aim of producing high quality libraries. Take a look at templates
and the STL. If your data structures are fairly ordinary like
linked lists then C++ may already have standard implementations.

and if given a choise that someone knows both c and c++ which one will
be convinent  ang faster for implementimg data structures??

since C++ is almost a super-set of C anything that can be
done in C can be done in C++. So speed-wise C++ should always
be able to closely match C.

The one exception is C's new "restict" keyword. In theory
compilers could produce faster code when restrict is used.
I've no idea if any actually do.

C++ has templates. Hence generic data structures can be written.
C has no equivalent facility. C++ has inline (the latest not
widely implemented C standard also has inline) which can
make things faster.

C++ can support something called template meta programming
in which some truely amzing things can be done. This
includes high performance libraries.

Why do you want fast data structures?


--
Nick Keighley

Both the tractability and the invisibility of the software product
expose its builders to perpetual changes in requirements...
-- Brookes
 
E

Erik Wikström

hello every one ,
i know this is a c++ forum ,but as i cudn't get any datastructures
forum ..iam
posting here :
can anyone tell me which is the best language to be used for
implementation of datastructures
by best i mean speed of operation :
and if given a choise that someone knows both c and c++ which one will
be convinent ang faster for implementimg data structures??

If find your question quite strange, the best language will probably be
the same language as you will be using the data structures with. Unless
you want to write the structures just for the fun of it, in which case
you should use the language you like the most or want to learn.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,769
Messages
2,569,580
Members
45,054
Latest member
TrimKetoBoost

Latest Threads

Top