How does software determine the order of characters when sorting?
828194
You have to remember that computers don't see letters, they see numerics that represent letters. They compare values against one another numerically and based on the type of sorting algorithm used (yes there are many of them and different software can use various forms of sorting) can sort the list appropriately.\n\nI am not one for whipping out many wikipedia answers, but wikipedia has a good article that shows you the various sorts that software often uses. Many of them are described in detail and you can get an idea of how they work.\n\nAs for windows I believe it uses a sorting style known as "Natural sorting" which to us isn't exactly straight forward, but to the computer it is perfectly reasonable. I have including a link to a small quick little article about how it works. If you want more info on this part, just do a search for the keywords "natural sorting"\n\nHope this is what you were looking for. Enjoy!
964569
Would it help to encode the characters before storing them, and decode the characters when reading them? That way you can easily mix character sets.\n\nRawlyn.
875755
Try tracing a very small example on paper to gain some insight into this.  Perhaps just two or three elements with at least two equal keys.  Then reverse the order of the two equal keys in the input set, and see if you still get the same result.  Tracing the algorithm like this will get you the answer in a manner that should give you some confidence.
244607
reverse( NewString.begin(), NewString.end() );\n\n(You will have to #include <algorithm> )
18305
They are in alphabetical order.\n\nE,f,f,o,s,s,t,t,z
111953
What exactly do u want to do when u say when u want to Left Format a string ? Is it alphabetically sorting the characters within the string, or simply showing up the text in the string to the left of the text editor ?\nAnd about writing to the file, there is a standard method that uses the FileOutputStream object to write to a file. I might be able to give u the exact code to write characters to a file, and include newline characters at the end of 15 chars (so that a new string can be written to a new line, at the very left) if you can elaborate a bit on ur problem. Happy Valentine's Day by the way ! :)
673564
It appears to be a string function, one that looks at the character at the position indicateded.  Don't quote me on VB syntax, but something like this \n\nvar string mystring = "Hello";\nmystring.IndexOf('e');  <-- this would give you a value of "1" (one), assuming the indexing starts at zero.
279221
Here you go\nhttp://linux.wku.edu/~lamonml/algor/sort/shell.html\n\nHere's another link\nhttp://en.wikipedia.org/wiki/Shell_sort\n\nnow, pls gimme my 10 points..
419823
You may have to be more specific.\n\nalgorithm.h is not a standard library, as such it will be impossible to know what kind of code is in it.\n\nThere are numerous sorting algorithms, some more efficient than others.  There's bubble-sort, insertion-sort, heap-sort, quick-sort, etc.  If you're interested in searching and sorting, try doing a google search.\n\nThere is a sort() tool for UNIX systems, but that uses data streams and pipes at the console level, not intended for use inside a program.\n\nIf you want, you can open up algorithm.h and take a look inside.  You won't be able to see what the function definitions are, but at least you can see what parameters it takes.  Also, if you're really lucky ;-) there will be comments in the file describing what kind of sort it uses.  Just do a little detective work, and you can get all the info you need.
245731
We can classify sorting techniques according to their underlying structure.\n\nSwap-based sorts begin conceptually with the entire list, and exchange particular pairs of elements (adjacent elements or elements with certain step like in  Shell sorts) moving toward a more sorted list. \nMerge-based sorts creates initial "naturally" or "unnaturally" sorted sequences, and then add either one element (insertion sort) or merge two already sorted sequences. \nTree-based sorts store the data, at least conceptually, in a binary tree; there are two different approaches, one based on heaps, and the other based on search trees. \nFinally, the other category catches sorts which use additional key-value information, such as radix or bucket sort. \n We can also classify sorting algorithms by several other criteria:\n\nComputational complexity (worst, average and best number of comparisons for several typical test cases, see below) in terms of the size of the list (n). Typically, good average number of comparisons is O(n log n) and bad is O(n2). Note that asymptotic analysis does not tell about algorithms behavior on small lists or worst case behavior. Worst case behavior is probably more important then average. For example "plain-vanilla" quicksort requires O(n2) comparisons in case of already sorted arrays: a very important in practice case.  Sort algorithms which only use an abstract key comparison operation always need at least O(n log n) comparisons on average; while sort algorithms which exploit the structure of the key space cannot sort faster than O(n log k) where k is the size of the keyspace.  Please note that the number of comparison is just convenient theoretical metric. In reality both moves and comparisons matter and on short keys the cost of move is comparable to the cost of comparison (even if pointers are used). \n  \nStability: stable sorting algorithms maintain the relative order of records with equal keys. If all keys are different the this distinction does not make any sense. But if there are equal keys, then  a sorting algorithm is stable if whenever there are two records R and S with the same key and with R appearing before S in the original list, R will appear before S in the sorted list. \n  \nMemory usage (and use of other computer resources). One large class of algorithms are "in-place sorting. They are generally slower than algorithms that use additional memory: additional memory can be used for mapping of keyspace.  Most fast stable algorithms use additional memory.  With the current 4G of memory of more of  memory and virtual memory used in all major OSes, the old emphasis on algorithms that does not require additional memory should be abandoned.  Speedup that can be achieved by using of a small amount of additional memory is considerable and it is stupid to ignore it.  Moreover you can use pointers and then additional space of the size N actually becomes size of N pointers. In real life when the records usually have size several times bigger then the size of a pointers (4 bytes in 32 bit CPUs) that makes huge difference and make those methods much more acceptable then they look form purely theoretical considerations. \n  \nThe difference between worst case and average behavior (quicksort is efficient only on the average, and its worst case in to order n2, while heapsort has an interesting property that the worst case is not much different form the an average case.  Behaviors on practically important data sets (completely sorted, inversely sorted and 'almost sorted' (1 to K permutations, where K is less then N/10) has tremendous practical implications that are often not addressed or addressed incorrectly in textbooks other then Knuth. \nAmong non-stable algorithms Shellsort is probably the most underappreciated and quicksort  is one of the most overhyped. Please note the quicksort is a fragile algorithm because the choice of pivot is equal to guessing an important proper
538436
Copy the code here: http://www.ozgrid.com/VBA/Sort.htm and follow the instructions in the middle of the page that begin: "To use this UDF push Alt+F11..."
697744
I'm not 100% sure I agree with that answer ({3,7,2...}), but regardless...\n\nQuicksort is a sorting algorithm (collect them all!) which breaks the problem of sorting a set of values into one of sorting two small sets of values, a strategy known as "divide and conquer".  It's also an "in place" sorting algorithm, meaning you can actually move values around in the set itself instead of having to work on copies.\n\nIn a quicksort, you pick a "partition" (I guess your teacher is calling it a "fence").  This can be any value in the set, and if your set is always nice & random like this you can just grab the first one instead of wasting time trying to find the median value or anything like that.\n\nOk, so in your example, your partition (fence) value is 10.  So, loop through the set and break it into two lists: everything less than 10, and everything greater than or equal to 10.  Now, you apply the same algorithm to the two lists.  Pick a pivot value in the "less than" list and split it into everything smaller than that value and everything greater than it.  Do the  same to the "greater than" list.  Keep narrowing down the sizes of these lists until you get to a list with a size of 1.  When you exit all the recursive calls, you'll find that the values in the set were sorted.\n\nIt's called a "quicksort" because it's incredibly fast compared to other sorting algorithms.  If written with threading in mind, the sorting tasks can even be split up among multiple CPUs if your system has more than one to make everything even faster.\n\nOh yeah, it's also ok to use a different sort algorithm after a while rather than recursively quicksorting these smaller & smaller lists.  So in that case you'd partition maybe once or twice...maybe three or four times...and then do a shell sort or something on the really small sets rather than break them down further.\n\nIt might help to watch a quicksort in action.  Check out the cool Java applet at this site (about halfway down):\n\nhttp://www.wanginator.de/studium/applets/quicksort_en.html\n\nYou'll have to put the values in one by one, but once you're done keep clicking "next step" to see how the partitioning and sorting works.\n\nOh yeah, I don't see why {3,7,2} should be the order of the "less than" set after just the first step.  Going left to right would give {2,3,7} and going right to left would give {7,3,2}.  What weird method of traversing a set gives that kind of order?
700222
It is always x and then y. thew way i remember it is because it goes in alphabetical order. hope it helps!
346469
When you look up words in the dictionary, you start with the first letter, then the second letter, etc.  It will always have it's place in line, according to alphabetical order.  If you wanted to alphabetize animal and animate, first you would look at the "a".. they are the same, so then you move on to the "n" and so on until you get to the "l" in animal and the "t" in animate.  Since l comes before t, animal will be in the dictionary before animate.\n\nWhen you compare numbers (especially on a number line), you start on the left and keep moving right. Which is bigger, 13475 or 13472?  The one's are the same, so you must go to the next number.  The 3's are the same, the 4's, etc until you get to 5 being bigger than 2.  Since everything else matched, then 13475 must be bigger than 13472.
784795
numbering pages beginning from 1 in ascending order
353749
Yes, there's a program called File Renamer Basic 2.1, this should sort your files out;\n\nhttp://www.download.com/File-Renamer-Basic/3000-2248_4-10306539.html?tag=lst-0-1
1071520
there are formatting standards (no dashes, use spaces to separate numbers)\n\na good summary is here:\nhttp://www.geocities.com/dtmcbride/reference/tel-fmt.html