Solved

deque quicksort

Posted on 2003-10-23
3
790 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

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
IdTCPClient1->Disconnect(); not working 3 76
Add values of each row in an array 3 64
Error creating a new C++ project in ,net 20 41
Precision Problem in C++ 7 44
Often, when implementing a feature, you won't know how certain events should be handled at the point where they occur and you'd rather defer to the user of your function or class. For example, a XML parser will extract a tag from the source code, wh…
Introduction This article is the first in a series of articles about the C/C++ Visual Studio Express debugger.  It provides a quick start guide in using the debugger. Part 2 focuses on additional topics in breakpoints.  Lastly, Part 3 focuses on th…
The goal of the video will be to teach the user the concept of local variables and scope. An example of a locally defined variable will be given as well as an explanation of what scope is in C++. The local variable and concept of scope will be relat…
The goal of the video will be to teach the user the difference and consequence of passing data by value vs passing data by reference in C++. An example of passing data by value as well as an example of passing data by reference will be be given. Bot…

861 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