We have quickly sketched in Chapter 4.7 the sequential and dichotomic/bisection search strategies to answer element membership queries: Does an element already belong to the data-set or not? In this chapter, we further describe the generic framework for inserting/deleting or modifying attributes of elements of a data-set. We revisit the linear sequential and logarithmic bisection searches on sets of complex data-structured elements: sets of objects. Since the bisection search requires arrays to be totally ordered, and since raw arrays of elements are very unlikely to be already sorted beforehand, we then present two methods for sorting data-sets:
-
(1) The selection sort, which iteratively selects the current smallest element of remaining sub-arrays, and
-
(2) The quicksort, which recursively sorts the arrays by partitioning elements.
Access this chapter
Tax calculation will be finalised at checkout
Purchases are for personal use only
Preview
Unable to display preview. Download preview PDF.
Author information
Authors and Affiliations
Corresponding author
Rights and permissions
Copyright information
© 2009 Springer-Verlag London
About this chapter
Cite this chapter
Nielsen, F. (2009). Searching and Sorting. In: A Concise and Practical Introduction to Programming Algorithms in Java. Undergraduate Topics in Computer Science. Springer, London. https://doi.org/10.1007/978-1-84882-339-6_6
Download citation
DOI: https://doi.org/10.1007/978-1-84882-339-6_6
Published:
Publisher Name: Springer, London
Print ISBN: 978-1-84882-338-9
Online ISBN: 978-1-84882-339-6
eBook Packages: Computer ScienceComputer Science (R0)