473,385 Members | 2,044 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

C- quicksort in-place and non-recursive

I've been looking online for C code for a quicksort that is both in-place and non-recursive. There are example of each but does anyone have a link to code that is both?
Apr 3 '08 #1
4 4878
weaknessforcats
9,208 Expert Mod 8TB
Er, I think non-recursive and in-place are mutually exclusive. I mean, doesn't in-place mean non-calling-anything?
Apr 3 '08 #2
In place means that the list is not copied in to subsequent sublists, but rather swapped around
Apr 3 '08 #3
JosAH
11,448 Expert 8TB
In place means that the list is not copied in to subsequent sublists, but rather swapped around
If you're interested in a nice big-Oh-wise stable in-place non-recursive sorting
algorithm check the heap sort algorithm. It has O(n*log(n)) performance just
like the quick sort algorithm.

kind regards,

Jos
Apr 3 '08 #4
weaknessforcats
9,208 Expert Mod 8TB
In place means that the list is not copied in to subsequent sublists, but rather swapped around
Of course. I must have been confused by in-line.

I need more coffee.
Apr 4 '08 #5

Sign in to post your reply or Sign up for a free account.

Similar topics

5
by: why | last post by:
Hi, just been curious. i have learn that quicksorting algorithm is more widely used then heapsort, despite having the same performance indication of O(n log n) anyone knows why? newbie
3
by: Lieven | last post by:
I want to write a generic quicksort over STL containers. We have to parallelize this algorithm afterwards. This is what I've got for now: template<typename containerIterator> void...
3
by: Lieven | last post by:
I want to make a quicksort algorithm that can take both a vector and a list. This is the code I've got. But I also want to give an argument that will be used for comparing the elements. I am used...
36
by: HERC777 | last post by:
just paste the below into notepad, call it iqsort.html double click it and your IE browser will run it. (neat! a universal programming language we can all run!) it falls out from the sort...
2
by: Sendell | last post by:
Sorry that this is such a trivial question... For an assignment I had to write the quicksort program: //This program sorts a set of integers using the quicksort method. #include "stdafx.h"...
0
by: StephDawg40 | last post by:
I am attempting to write a Quicksort algorithm and my partition function is not behaving correctly. here is the code int CDataAnalyzerDlg::partition1(int first, int last) { int pivot =...
6
by: Baltazar007 | last post by:
Does anyone know how to make quicksort for single linked list without using array? I know that mergesort is maybe better but I need quicksort!! thnx
2
by: simo | last post by:
Hello to all... I am trying to write an algorithm parallel in order to realize the quicksort. They are to the first crews with C and MPI. The algorithm that I am trying to realize is PARALLEL...
8
by: aparnakakkar2003 | last post by:
hello can any one tell me how i can create program to sort string list(standard template library) using quicksort.
3
by: jollyfolly | last post by:
Could you please help me find the error. I myself have (i might be wrong) boiled it down to the for loop because it somehow magically converts a list into an int and tries to iterate over that. But I...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.