Sunday, June 30, 2013

sorts and iterators

Newsgroup: comp.lang.c++

Subject: sorts and iterators

From: Christopher Pisz <cpisz@...>

Date: Sun, 30 Jun 2013 10:50:25 -0500



I am brushing up for an upcoming interview. They let me know beforehand

that they will be asking about sorting algorithms and expect me to write

some code. They let me know I should study, so I am studying :)



I know the old college academic exercises where I can make a struct that

represents a node and implement my own linked list, etc. etc. I'd like

to try some custom sorts and performance time them like I would in the

real world. So, I ask myself, how would I do it in the real world?



I would most likely have some stl container or a class that implements

iterators. I am also aware the stl has a build in sort with O(nlog(n))

complexity.



So, how do I go about implementing a sort that uses iterators? I am not

really sure where to start.



I did some Googling and see stl sort requires swap and a move copy. I

believe these are new c++13 features? Can we assume I am still using the

2003 standard for now and then try again using C++13?



My current job was using really out of date tools and I haven't had the

chance yet to catch up on the new standard.









via Usenet Forums - Usenet Search,Free Usenet - comp.lang.c++ http://www.pocketbinaries.com/usenet-forums/showthread.php?32152-sorts-and-iterators&goto=newpost

View all the progranning help forums at:

http://www.pocketbinaries.com/usenet-forums/forumdisplay.php?128-Coding-forums

No comments:

Post a Comment