On 25 Apr, 10:21, mohi <mohangupt...@g mail.comwrote:
i know this is a c++ forum ,but as i cudn't get any datastructures
forum ..iam posting here :
you could try comp.lang.progr amming 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