On Dec 8, 2008, at 7:43 PM, Steven D'Aprano wrote:
On Mon, 08 Dec 2008 08:18:27 -0700, Joe Strout wrote:
On Dec 7, 2008, at 10:26 PM, Group wrote:
Now, I want to write a Red-Black Tree, and a List structure. In C/C
+ +,
I can
use pointers to refer to children notes (or next notes). But, i
On Mon, 08 Dec 2008 08:18:27 -0700, Joe Strout wrote:
> On Dec 7, 2008, at 10:26 PM, Group wrote:
>
>> Now, I want to write a Red-Black Tree, and a List structure. In C/C+ +,
>> I can
>> use pointers to refer to children notes (or next notes). But, in
>> Python, how
>> can I do it? Except the s
On Dec 8, 9:18 am, Joe Strout <[EMAIL PROTECTED]> wrote:
> On Dec 7, 2008, at 10:26 PM, Group wrote:
>
> > Now, I want to write a Red-Black Tree, and a List structure. In C/C+
> > +, I can
> > use pointers to refer to children notes (or next notes). But, in
> > Python, how
> > can I do it? Exce
On Dec 7, 2008, at 10:26 PM, Group wrote:
Now, I want to write a Red-Black Tree, and a List structure. In C/C+
+, I can
use pointers to refer to children notes (or next notes). But, in
Python, how
can I do it? Except the sequence, I know not any way.
Any variable in Python is a reference,
In case the OP is interested here is a more complete
implementation (others are welcome to comment):
http://codepad.org/drIhqb7Z
Enjoy :)
cheers
James
--
--
-- "Problems are solved by method"
--
http://mail.python.org/mailman/listinfo/python-list
On Mon, Dec 8, 2008 at 4:25 PM, Chris Rebert <[EMAIL PROTECTED]> wrote:
> No apology necessary of course, i just didn't want the newbie OP to
> pick up any bad Python coding habits. Apologies that I might have
> phrased my criticism a bit harshly.
No not at all :) I do use class variables in some
On Sun, Dec 7, 2008 at 10:17 PM, James Mills
<[EMAIL PROTECTED]> wrote:
> On Mon, Dec 8, 2008 at 4:13 PM, Chris Rebert <[EMAIL PROTECTED]> wrote:
>> The following three lines serve no purpose and can only lead to confusion:
>>> value = None
>>> prev = None
>>> next = None
>
> You are absolute
On Mon, Dec 8, 2008 at 4:13 PM, Chris Rebert <[EMAIL PROTECTED]> wrote:
> The following three lines serve no purpose and can only lead to confusion:
>> value = None
>> prev = None
>> next = None
You are absolutely right :)
Updated code:
#!/home/jmills/bin/python -i
class Node(object):
On Sun, Dec 7, 2008 at 10:09 PM, James Mills
<[EMAIL PROTECTED]> wrote:
> Hi,
>
> This is really really really pointless code and a really really pointless
> exercise, but nonetheless, here is a very very basic and minimal
> implementation of what you're expecting. This should almost
> *never* be d
Hi,
This is really really really pointless code and a really really pointless
exercise, but nonetheless, here is a very very basic and minimal
implementation of what you're expecting. This should almost
*never* be done in Python! Python is a superior dynamic programming
language, but it's NOT C!
Chris Rebert wrote:
On Sun, Dec 7, 2008 at 9:26 PM, Group <[EMAIL PROTECTED]> wrote:
Hello, I'm studying algorithom. For concentrating on the question itself, I
intend to use Python to implement the algorithoms.
Now, I want to write a Red-Black Tree, and a List structure. In C/C++, I can
use
On Sun, Dec 7, 2008 at 9:26 PM, Group <[EMAIL PROTECTED]> wrote:
> Hello, I'm studying algorithom. For concentrating on the question itself, I
> intend to use Python to implement the algorithoms.
>
> Now, I want to write a Red-Black Tree, and a List structure. In C/C++, I can
> use pointers to refe
Hello, I'm studying algorithom. For concentrating on the question itself, I
intend to use Python to implement the algorithoms.
Now, I want to write a Red-Black Tree, and a List structure. In C/C++, I
can
use pointers to refer to children notes (or next notes). But, in
Python, how
can I do it
13 matches
Mail list logo