• ## Bus error 10 in Radix Tree C program2018-03-13

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

• ## convert number from base n to an integer2013-09-16

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

• ## Base-N encoding of a byte array2013-01-01

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).

• ## implementing a patricia trie in java2012-10-28

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

• ## Using Javascript parseInt() and a Radix Parameter2012-05-01

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

• ## How to convert a Binary String to a base 10 integer in Java2012-04-16

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

• ## Why does the FixNum#to_s method in in Ruby only accept radixes from 2 to 36?2012-03-22

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

• ## Radix sort for two's complement binary numbers2011-12-07

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

• ## Radix sort implemented in c++ for string2011-11-22

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>

• ## Assist with implementing Radix Sort in JavaScript2011-10-29

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

• ## How do I reverse the output of a program?2011-10-20

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

• ## JSLint says "missing radix parameter"; what should I do?2011-10-19

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

• ## Whats going on behind the scenes with method - public static long parseLong(String s,int radix)2011-10-11

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

• ## Standard radix for decimal base?2011-07-15

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

Tags: numbers, base, decimal, prefix, radix
• ## CUDA Programming with Thrust Library Radix Sort2011-06-30

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

• ## How does one decode Base64? 2011-05-21

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://

Tags: base64, encoding, binary data, decode, radix
• ## Is radix sort the only non-comparison sorting algorithm?2011-05-12

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