Continue to Site

Welcome to our site!

Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

  • Welcome to our site! Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

Sorting 4 values with Min/Max components

Status
Not open for further replies.

EngIntoHW

Member
Hey,

I'm trying to prove that it's you cannot use less than 5 Min/Max components in order to sort 4 input values.

Anyone has an idea how to?

Thank you.

sort4-jpg.46471
 

Attachments

  • Sort4.jpg
    Sort4.jpg
    54.6 KB · Views: 376
Can't you sort A&D and B&C and then sort the two highs and two lows?

Edit, it doesn't work so forget this.

Mike.
 
Last edited:
EngIntoHW,

It takes 1 level of sort to exchange the inputs by one position, such as from A to B. It takes 3 levels of sort to exchange the inputs 3 positions, such as from A to D. Each level except the last needs 2 units because of the 4 inputs. The last needs only one unit because only 2 inputs need to be sorted. That totals 5 units minimum.

Ratch
 
Status
Not open for further replies.

Latest threads

New Articles From Microcontroller Tips

Back
Top