8 Topics

Member Avatar for
Member Avatar for c1c2c3c4c

im trying to figure out why we are using binary computers insted of ternary. from what i can tell the only valid argument is the cost of storage. basicly for those of you who dont know that a ternary computer is, its a computer that uses three positions of the …

Member Avatar for rubberman
0
625
Member Avatar for suhrud.l

For an array of n int variables, When does binary search perform better than ternary search?? Also, reverse case, ie when does ternary search perform better than binary search? Why is binary search a more preferred method of searching for integers entered in an array??

Member Avatar for c1c2c3c4c
0
240
Member Avatar for bgraw

A Ternary Tree (T) is a tree in which every non terminal node has at most 3 children. We will use T to simulate the following activity: A set of P candidates must pass a set of exams ordered in an array of N exam codes (an exam code is …

Member Avatar for bakabozza
0
212
Member Avatar for TrustyTony

Here is my take on [balanced ternary](http://en.wikipedia.org/wiki/Balanced_ternary) conversion (the base considered by [Donald Knuth](http://en.wikipedia.org/wiki/Donald_Knuth) "Maybe the prettiest")

1
946
Member Avatar for TrustyTony

Here is base conversion function written to deal also with [negative bases](http://en.wikipedia.org/wiki/Negative_base). Not yet balanced ternary, where numbers themselves can be negative, maybe later I add it.. Based on the code in the wikipedia article, which has bug for converting 0.[**Edit: I fixed the bug in wikipedia**]

Member Avatar for TrustyTony
0
236
Member Avatar for ibthevivin

I'm wondering if there is a way to simplify this program. I feel like I wasted a lot of time on all the ternary codes at the bottom for labeling "bill" for the three values (ten$, five$, and one$). Also for deriving the values for q,d,n, and p I feel …

Member Avatar for JamesCherrill
0
137
Member Avatar for subith86

In C++ I'm able to do something like this [CODE](some_condition)? function1():function2();[/CODE] When i tried the same thing in Java it's not possible. It wants some variable to hold the result even though the return type of function1 and function2 are void. Is there any other way to do it other …

Member Avatar for subith86
0
130
Member Avatar for TrustyTony

Do you know that there is clean way of doing what C-language ternary operator ? does in Python's recent versions. It is if with special twist. The syntax is: [CODE]'The value if true' if <condition> else 'Value when false'[/CODE] Values can be any type. You can put this structure to …

0
983

The End.