?
Solved

deque quicksort

Posted on 2003-10-23
3
Medium Priority
?
815 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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 300 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

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Introduction This article is a continuation of the C/C++ Visual Studio Express debugger series. Part 1 provided a quick start guide in using the debugger. Part 2 focused on additional topics in breakpoints. As your assignments become a little more …
Go is an acronym of golang, is a programming language developed Google in 2007. Go is a new language that is mostly in the C family, with significant input from Pascal/Modula/Oberon family. Hence Go arisen as low-level language with fast compilation…
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 viewer will learn how to pass data into a function in C++. This is one step further in using functions. Instead of only printing text onto the console, the function will be able to perform calculations with argumentents given by the user.
Suggested Courses

765 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