Solved

deque quicksort

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

Find Ransomware Secrets With All-Source Analysis

Ransomware has become a major concern for organizations; its prevalence has grown due to past successes achieved by threat actors. While each ransomware variant is different, we’ve seen some common tactics and trends used among the authors of the malware.

Join & Write a Comment

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…
This article shows you how to optimize memory allocations in C++ using placement new. Applicable especially to usecases dealing with creation of large number of objects. A brief on problem: Lets take example problem for simplicity: - I have a G…
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 learn additional member functions of the vector class. Specifically, the capacity and swap member functions will be introduced.

760 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

19 Experts available now in Live!

Get 1:1 Help Now