String matching algorithms http://www-igm.univ-mlv.fr/~lecroq/string/? GCC Hacks: http://www.ibm.com/developerworks/linux/library/l-gcc-hacks/index.html http://en.wikipedia.org/wiki/Spaghetti_sort Lazy initialization: (09:53:48 PM) Joman Chu (AIM): keep a counter of how many things inserted into the array so far (09:53:55 PM) Joman Chu (AIM): keep three arrays of the same length (09:54:01 PM) Joman Chu (AIM): one of the arrays will be the actual array to store things in (09:54:12 PM) Joman Chu (AIM): say you put something in position i (09:54:30 PM) Joman Chu (AIM): and say thats the first thing you put in (09:54:33 PM) Joman Chu (AIM): in the one of the other arrays, you put 1 in position i (09:54:45 PM) Joman Chu (AIM): and in the third array, you put i in position 1 (09:54:58 PM) Joman Chu (AIM): (0 if you zero index) (09:55:10 PM) Joman Chu (AIM): when you do a lookup (09:55:16 PM) Joman Chu (AIM): you need to determine if you got a junk value (09:55:35 PM) Joman Chu (AIM): so you look up position i in the second array (09:55:36 PM) Joman Chu (AIM): you see 1 (09:55:46 PM) Joman Chu (AIM): look up position 1 in the second array, you see i (09:55:56 PM) Joman Chu (AIM): they agree, so youre able to go to positoin i and get your value (09:56:19 PM) Joman Chu (AIM): say you look up j (which is a junk value) (09:56:43 PM) Joman Chu (AIM): you look up position j in the second array, if you get a value larger than your count, then its obviously junk (09:56:47 PM) Joman Chu (AIM): say you dont (09:56:53 PM) Joman Chu (AIM): so you look up the value in the third array (09:57:01 PM) Joman Chu (AIM): that value wont be equal to j (09:57:13 PM) Joman Chu (AIM): so you know theres a junk value in j