C
Christopher Pisz
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.
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.