Solved

Natural sort or Alphanumeric sort algorithm

Posted on 2011-02-20
6
913 Views
Last Modified: 2013-12-18
Hi

Has anyone worked on Natural Sorting or Alphanumeric sorting of given list. I am planning to write a lotus script code for this, but would like to know the algorithm or technique for such a sort.


Regards
Javed Khan
0
Comment
Question by:javakthar
  • 3
  • 2
6 Comments
 
LVL 37

Expert Comment

by:TommySzalapski
Comment Utility
Just use merge sort or insertion sort or whatever your favorite standard sorting algorithm.
The only extra thing you need to do is to write your own less than function. Just parse the string and if you see a number, count the digits first (or extract them, convert to integer and compare).
0
 
LVL 22

Expert Comment

by:mbonaci
Comment Utility
You can use QuickSort/InsertionSort (balanced combination) located in your mail db > form Group > action "Sort members list" calls > QuickSort in form's Globals
0
 

Accepted Solution

by:
javakthar earned 0 total points
Comment Utility
I referred to Dave Koells Algorithm for Alphanumeric Sorting and have created a similar functionality in Lotus Script, with some changes. With this i am now able to do the required alphanumeric sorting.

Any facing similar problem can get in touch with me for the code.
0
How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

 
LVL 22

Expert Comment

by:mbonaci
Comment Utility
If you want to publish the code you can do that here and/or (even better) on openNTF.
I'm sure it'll be of good use to someone.
0
 

Author Comment

by:javakthar
Comment Utility
Here is the alphanumeri comparison code.  This can be used in any of the sorting methods such as quick sort , selection sort or any other.

This code can be inroduced at the point where the comparison is being done.

I could not access this site for couple of days, hence the delay.
Alphanum.txt
0
 

Author Closing Comment

by:javakthar
Comment Utility
There are various scenarios for testing the complete functioning of alphanumeric sorts. My code works well in the scenarios which i have tested so far. It could fail in some unknown scenarios.
0

Featured Post

IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

Article by: Nadia
Suppose you use Uber application as a rider and you request a ride to go from one place to another. Your driver just arrived at the parking lot of your place. The only thing you know about the ride is the license plate number. How do you find your U…
Prime numbers are natural numbers greater than 1 that have only two divisors (the number itself and 1). By “divisible” we mean dividend % divisor = 0 (% indicates MODULAR. It gives the reminder of a division operation). We’ll follow multiple approac…
Excel styles will make formatting consistent and let you apply and change formatting faster. In this tutorial, you'll learn how to use Excel's built-in styles, how to modify styles, and how to create your own. You'll also learn how to use your custo…
This tutorial demonstrates a quick way of adding group price to multiple Magento products.

771 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

10 Experts available now in Live!

Get 1:1 Help Now