Solved

deque quicksort

Posted on 2003-10-23
3
783 Views
Last Modified: 2012-08-13
Hey,
         Im having trouble with quicksort for deques.  Can somebody please help me with it?  Im lost.  I dont know how to start it.
0
Comment
Question by:mpmcroy
3 Comments
 
LVL 9

Expert Comment

by:tinchos
ID: 9611764
Hi mpmcroy

try to explain what you need to do a little more, and tell me how you plan to do it.......... then I'll be able to help you a little more
0
 
LVL 7

Expert Comment

by:burcarpat
ID: 9611858
what wrong with using std::sort ( which is not quicksort in the latest stl implementations but regardless )

-- ba
0
 
LVL 4

Accepted Solution

by:
PhilipNicoletti earned 100 total points
ID: 9613921
also note : if by "quicksort" you mean the C library qsort() routine, you
can not use it. qsort() expects the "container" to be in contiguous memory.
So while you can use qsort() on a vector (passing &v[0]), you can not use
it on deque.

burcarpat gave the solution : use std::sort()
0

Featured Post

Announcing the Most Valuable Experts of 2016

MVEs are more concerned with the satisfaction of those they help than with the considerable points they can earn. They are the types of people you feel privileged to call colleagues. Join us in honoring this amazing group of Experts.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Unlike C#, C++ doesn't have native support for sealing classes (so they cannot be sub-classed). At the cost of a virtual base class pointer it is possible to implement a pseudo sealing mechanism The trick is to virtually inherit from a base class…
Article by: SunnyDark
This article's goal is to present you with an easy to use XML wrapper for C++ and also present some interesting techniques that you might use with MS C++. The reason I built this class is to ease the pain of using XML files with C++, since there is…
The goal of the tutorial is to teach the user how to use functions in C++. The video will cover how to define functions, how to call functions and how to create functions prototypes. Microsoft Visual C++ 2010 Express will be used as a text editor an…
The viewer will be introduced to the member functions push_back and pop_back of the vector class. The video will teach the difference between the two as well as how to use each one along with its functionality.

815 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

7 Experts available now in Live!

Get 1:1 Help Now