I'm writing a program which does operations on a Radix trie and I'm stuck at add() function, getting the Bus error 10. void addRec(struct tNode *p, char *w) { int matches = prefixMatch(p->word,w); bool insert = true; if ((p == root) || ((matches > 0
I am working on a program to sort a list of numbers using a radix sort but I keep getting stuck in what I think is an infinite loop. I think that it is either my main sort function or my counting function. Any ideas on what I am doing wrong? void rad
So I'm hoping to get a little guidance on this one. I have a function that takes a radix(base) and then using getchar() will get the number to convert from the given radix to an integer representation. The only argument given is the radix number, the
A couple of days ago I came across this CodeReview for Base-36 encoding a byte array. However, the answers that followed didn't touch on decoding back into a byte array, or possibly reusing the answer to perform encodings of different bases (radix).
I'm trying to rewrite a c++ patricia trie in java. The c++ code is from here full source code I'm a bit stuck. So here's my understanding: #define ZEROTAB_SIZE 256 head->key = (char*)calloc(ZEROTAB_SIZE, 1); we create an array of 256 bits for the
Can anyone explain how the parseInt() functions works and what the Radix Parameter is? As a case study, I am trying to get to grips with this code snippet: var maxChars = parseInt( formField.attr('maxlength') ? formField.attr('maxlength') : counter.t
I have an array of Strings that represent Binary numbers (without leading zeroes) that I want to convert to their corresponding base 10 numbers. Consider: binary 1011 becomes integer 11 binary 1001 becomes integer 9 binary 11 becomes integer 3 etc. W
I looked at the documentation and even peeked at the C source, and I can't see why they limited the accepted radixes to 2..36. Anybody know? --------------Solutions------------- As others have pointed out, radix < 2 is troublesome to render. and t
I have a question about Radix Sort implementations. For 16-bit two's complement numbers in binary how would a Radix Sort work? I'm not entirely sure how an implementation would be constructed (possibly because I have a hard time doing two's complemen
i just need radix sort implementation in c++ language which works for strings i already have the one which works for normal integers vector < vector < int> > blocks[7]; void radixSort(int rsarr[],int length){ int index; vector<int>
I need some help implementing the Radix sort algorthim in JavaScript. I found this example online, with the following code, but I don't understand how I call the function since it appears to be tailored for that site: // Radix sort a (base 2) // Numb
I have to convert decimal numbers like 43.62 to binary. So i first wrote a basic program that converts 43 into binary. But I notice that my program prints out the binary number in reverse, so it prints 1 1 0 1 0 1 instead of 1 0 1 0 1 1. how can I fi
I ran JSLint on this JavaScript code and it said: Problem at line 32 character 30: Missing radix parameter. This is the code in question: imageIndex = parseInt(id.substring(id.length - 1))-1; What is wrong here? --------------Solutions------------- I
I need to generate a consistent unique Long based on the name of the package. Instead of using "Convert string to long" in Eclipse I think I can achieve the same task at run time by using method public static long parseLong(String s,int radix) ? I th
If I need to identify hex, octal, or binary numbers, I can just use prefixes 0x, 0, 0b. They aren't necessarily universal but are pretty recognizable in the programming world. Is there an identifier like that for decimal (base 10) numbers? I would li
Newbie on Thrust - in my VS2010 C++ program, I have working fine: #include <thrust/sort.h> thrust :: stable_sort_by_key (sortkey , sortkey + nmu, indexes ); But now I want to use thrust :: stable_radix_sort_key. I've added the include - #includ
As seen here, they have the line ZG9udGJlYWhhdGVyc3RhcnR1cCtoYWNrZXJuZXdzQGdtYWlsLmNvbQ==. How would one go about decoding this line of Base64? --------------Solutions------------- Base64-decode it. For example, put it in this online decoder: http://
As the title says, is radix sort the only non-comparison sorting algorithm? My guess is yes. --------------Solutions------------- No - there's counting sort and bucket sort also, among others. Check the Wikipedia article for more info. Any set can be
I have a five-character String and I want to use those five characters as an ASCII-encoded (printable) number. The simplest way to achieve this is to use Long.toString(number, Character.MAX_RADIX); This will give me numbers from "0" to "zzzzz". Unfor
C has the convention where 0x____ means a hexadecimal literal number, and I've seen 0b____ for binary literal number (most notably in Java 7 Project Coin). Is there anything out there for representing arbitrary radices? (up to base 36) (e.g. 36rA0CZ