Wrox Programmer Forums
| Search | Today's Posts | Mark Forums Read
BOOK Programming Interviews Exposed: Secrets to Landing Your Next Job 3rd Edition
This is the forum to discuss the Wrox book Programming Interviews Exposed: Secrets to Landing Your Next Job, 3rd Edition by John Mongan, Noah Kindler, Eric Giguere; ISBN: 978-1-118-26136-1
Welcome to the p2p.wrox.com Forums.

You are currently viewing the BOOK Programming Interviews Exposed: Secrets to Landing Your Next Job 3rd Edition section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
  #1 (permalink)  
Old May 27th, 2016, 02:50 AM
Registered User
Points: 20, Level: 1
Points: 20, Level: 1 Points: 20, Level: 1 Points: 20, Level: 1
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: May 2016
Posts: 4
Thanks: 0
Thanked 0 Times in 0 Posts
Default Quick sort with duplicate values

Hi all,

I published a new thread to the wrong forum:

Quicksort with duplicate values

I meant it to be for 3d edition, not 2d.
If anybody could move it to this forum that would be great?

Anyway, feel free to react!

Thanks

Olivier
  #2 (permalink)  
Old July 11th, 2017, 10:58 AM
Wrox Author
Points: 21, Level: 1
Points: 21, Level: 1 Points: 21, Level: 1 Points: 21, Level: 1
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Oct 2012
Posts: 8
Thanks: 0
Thanked 0 Times in 0 Posts
Default

In my tests the implementation on pp 128-29 works fine when there are duplicated values. If there are duplicates of the pivot value, they end up in the right (rather than left) partition.

If you're seeing different behavior than this, can you post an input that reproduces the failure? (And describe the nature of the failure: array returned in unsorted order, infinite recursion, etc.?)

John
  #3 (permalink)  
Old May 18th, 2018, 10:22 AM
Registered User
Points: 20, Level: 1
Points: 20, Level: 1 Points: 20, Level: 1 Points: 20, Level: 1
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: May 2016
Posts: 4
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Yes, it's almost a year later... but better late then never!

I agree with you John, I misinterpreted the algorithm in the book, it's perfectly fine.
I will post a fix of my own code in the other thread.

Thanks for replying!


Similar Threads
Thread Thread Starter Forum Replies Last Post
Quick Sort in C Code yulin11 Visual C++ 2 June 13th, 2018 05:27 AM
VBA code to return values of rows that returns row numbers of duplicate values bharatmvs Excel VBA 1 December 5th, 2014 03:19 AM
Assistance with duplicate values fattmatt SQL Language 6 October 21st, 2009 04:26 AM
Quick workaround for sort, group by program & date? athos XSLT 19 May 18th, 2009 01:50 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.