Re: Data structures and Algorithms

2020-06-30 Thread DL Neil via Python-list
++ there is a lot of cruft around managing memory and allocating sizes, not to mention additional verbiage. In Python you are far freer to concentrate on the data structures and algorithms themselves. Maybe start here: https://duckduckgo.com/html?q=python%20data%20structures%20and%20algorithms

Re: Data structures and Algorithms

2020-06-30 Thread Richard Damon
less so) in C++ > there is a lot of cruft around managing memory and allocating sizes, not > to mention additional verbiage. In Python you are far freer to > concentrate on the data structures and algorithms themselves. > > Maybe start here: > > > https://d

Re: Data structures and Algorithms

2020-06-30 Thread Cameron Simpson
ing sizes, not to mention additional verbiage. In Python you are far freer to concentrate on the data structures and algorithms themselves. Maybe start here: https://duckduckgo.com/html?q=python%20data%20structures%20and%20algorithms%20tutorials Cheers, Cameron Simpson -- https://mail.python.or

Data structures and Algorithms

2020-06-30 Thread satyaprasad
Hi, I am currently in learning process of python have been worked on some desktop application using pyqt . I want improve my DSA area but i searched so many videos mot sure how to start . 1.Do i really need learn datastructures in c or c++ to get complete logical details. 2 .or shall i start learn

Re: Questions on Using Python to Teach Data Structures and Algorithms

2007-11-08 Thread Scott David Daniels
Wayne Brehaut wrote: ... > For learning DSA it's more important to have a clear, well-written and > well-documented implementation in a language of interest (again, > especially, the core language in one's programs) than just "using" or > even inspecting and trying to learn subtle details of some p

Re: Questions on Using Python to Teach Data Structures and Algorithms

2007-11-07 Thread Wayne Brehaut
On Thu, 28 Sep 2006 17:32:06 +0200, Fredrik Lundh <[EMAIL PROTECTED]> wrote: >Ramon Diaz-Uriarte wrote: > >> Going back to the original question, a related question: does anybody >> know why there are so few books on data structures and algorithms that >> use Pyth

Re: Questions on Using Python to Teach Data Structures and Algorithms

2007-11-07 Thread Wayne Brehaut
On Thu, 28 Sep 2006 17:23:25 +0200, "Ramon Diaz-Uriarte" <[EMAIL PROTECTED]> wrote: >Going back to the original question, a related question: does anybody >know why there are so few books on data structures and algorithms that >use Python? > >I remember that, at

Re: Questions on Using Python to Teach Data Structures and Algorithms

2006-09-29 Thread sturlamolden
t trying to emulate > their _behavior_ with one-dimensional python lists. The original poster was asking about using Python for teaching data structures and algorithms, and the implementation details of Python lists in particular. It may not be obvious that they are essentially arrays under the hood.

Re: Questions on Using Python to Teach Data Structures and Algorithms

2006-09-29 Thread Bruno Desthuilliers
Dennis Lee Bieber wrote: > On 28 Sep 2006 21:17:38 -0700, "MonkeeSage" <[EMAIL PROTECTED]> > declaimed the following in comp.lang.python: > > (Coming in from the cold) >> I guess you were talking about implementing the _structure_ of lisp >> lists in python syntax (as you seem to imply), not

Re: Questions on Using Python to Teach Data Structures and Algorithms

2006-09-28 Thread MonkeeSage
Dennis Lee Bieber wrote: > Though if this suddenly inspires the creation of a Common LISP > interpreter written in Python, I may want to close my eyes Hehe! I actually thought of trying that once, but I realized that I'm too stupid and / or lazy to pull it off. ;) Regards, Jordan -- http

Re: Questions on Using Python to Teach Data Structures and Algorithms

2006-09-28 Thread MonkeeSage
sturlamolden wrote: > Thus I stand by my original claim. Essentlially: > > def cons(car,cdr): return (car,cdr) # or [car,cdr] > def car(cons): return cons[0] > def cdr(cons): return cons[1] I guess you were talking about implementing the _structure_ of lisp lists in python syntax (as you seem to i

Re: Questions on Using Python to Teach Data Structures and Algorithms

2006-09-28 Thread Gabriel G
At Thursday 28/9/2006 12:23, Ramon Diaz-Uriarte wrote: Going back to the original question, a related question: does anybody know why there are so few books on data structures and algorithms that use Python? I remember that, at least ~ 12 years ago there were many (and very good) books that

Re: Questions on Using Python to Teach Data Structures and Algorithms

2006-09-28 Thread Ramon Diaz-Uriarte
On 9/28/06, Fredrik Lundh <[EMAIL PROTECTED]> wrote: > Ramon Diaz-Uriarte wrote: > > > Going back to the original question, a related question: does anybody > > know why there are so few books on data structures and algorithms that > > use Python? > > Prob

Re: Questions on Using Python to Teach Data Structures and Algorithms

2006-09-28 Thread sturlamolden
list. In Python you have the exactly same thing. The original poster was asking about using Python for teaching data structures and algorithms. Chaining together elements in e.g. a linked list or a binary tree is elementary concepts. This shows how it can be done in Python without having to define &quo

Re: Questions on Using Python to Teach Data Structures and Algorithms

2006-09-28 Thread sturlamolden
sturlamolden wrote: > Remember that O(1) is not neccesarily faster than O(N)! Unless your > linked list is very big, you will get something called a 'cache miss' > inside your CPU. Thus it is usually more efficient to work with dynamic > arrays. This was a bit ackwardly formulated. What I was tr

Re: Questions on Using Python to Teach Data Structures and Algorithms

2006-09-28 Thread Fredrik Lundh
sturlamolden wrote: > I seem to remember that a cons joins two items, it doesn't grow a > strait list. http://www.lisp.org/HyperSpec/Body/fun_cons.html "If object-2 is a list, cons can be thought of as producing a new list which is like it but has object-1 prepended." -- http://mail.python.

Re: Questions on Using Python to Teach Data Structures and Algorithms

2006-09-28 Thread sturlamolden
Brendon Towle wrote: > > def cons(a,b) > >return [a,b] > > should be: > return [a].extend(b) I seem to remember that a cons joins two items, it doesn't grow a strait list. A lisp list is a special case of a binary tree. How would you build a tree structure with your cons? I think you ar

Re: Questions on Using Python to Teach Data Structures and Algorithms

2006-09-28 Thread Brendon Towle
On 28 Sep 2006, at 12:45 PM, [EMAIL PROTECTED] wrote: > From: "MonkeeSage" <[EMAIL PROTECTED]> > Subject: Re: Questions on Using Python to Teach Data Structures and > Algorithms > To: python-list@python.org > > [snip] > But Brendon's code also

Re: Questions on Using Python to Teach Data Structures and Algorithms

2006-09-28 Thread MonkeeSage
Bruno Desthuilliers wrote: > Brendon Towle wrote: > > Some of your Lisp translations are subtly off... > > Seems correct to me. Lisp lists are linked lists, not arrays. Actually, Brendon was correct. In lisp / scheme: (cons 1 '(2 3)) -> (1 2 3) (car '(1 2 3)) -> 1 (cdr '(1 2 3)) -> (2 3) But Bre

Re: Questions on Using Python to Teach Data Structures and Algorithms

2006-09-28 Thread Steve Holden
Brendon Towle wrote: > Some of your Lisp translations are subtly off... > > > >>Date: 28 Sep 2006 02:49:50 -0700 >>From: "sturlamolden" <[EMAIL PROTECTED]> >>Subject: Re: Questions on Using Python to Teach Data Structures and >> Algorit

Re: Questions on Using Python to Teach Data Structures and Algorithms

2006-09-28 Thread Fredrik Lundh
Ramon Diaz-Uriarte wrote: > Going back to the original question, a related question: does anybody > know why there are so few books on data structures and algorithms that > use Python? Probably because Python has "better than textbook" implementations of core structure

Re: Questions on Using Python to Teach Data Structures and Algorithms

2006-09-28 Thread Bruno Desthuilliers
Brendon Towle wrote: > On 28 Sep 2006, at 8:05 AM, [EMAIL PROTECTED] wrote: > >> From: Bruno Desthuilliers <[EMAIL PROTECTED]> >> >> Brendon Towle wrote: >>> Some of your Lisp translations are subtly off... >> >> Seems correct to me. Lisp lists are linked lists, not arrays. >> >>> From: "stur

Re: Questions on Using Python to Teach Data Structures and Algorithms

2006-09-28 Thread Ramon Diaz-Uriarte
Going back to the original question, a related question: does anybody know why there are so few books on data structures and algorithms that use Python? I remember that, at least ~ 12 years ago there were many (and very good) books that used Pascal for this topic. So when I did my own search for

Re: Questions on Using Python to Teach Data Structures and Algorithms

2006-09-28 Thread Steve Holden
[EMAIL PROTECTED] wrote: > efrat: [...] > >>then why was the name "list" chosen? > > > I'd too love to know why the wrong "list" name was chosen for them, > instead of "array". (Maybe because "list" is shorter, or because ABC > called them "lists"...) > I suspect it's because of their intrinsic

Re: Questions on Using Python to Teach Data Structures and Algorithms

2006-09-28 Thread Brendon Towle
On 28 Sep 2006, at 8:05 AM, [EMAIL PROTECTED] wrote: > From: Bruno Desthuilliers <[EMAIL PROTECTED]> > Subject: Re: Questions on Using Python to Teach Data Structures and > Algorithms > To: python-list@python.org > > Brendon Towle wrote: >> Some of your Li

Re: Questions on Using Python to Teach Data Structures and Algorithms

2006-09-28 Thread Bryan Olson
efrat wrote: > I'm planning to use Python in order to teach a DSA (data structures > and algorithms) course in an academic institute. If you could help out > with the following questions, I'd sure appreciate it: > 1. What exactly is a Python list? It's almost exa

Re: Questions on Using Python to Teach Data Structures and Algorithms

2006-09-28 Thread Bruno Desthuilliers
Brendon Towle wrote: > Some of your Lisp translations are subtly off... Seems correct to me. Lisp lists are linked lists, not arrays. > >> Date: 28 Sep 2006 02:49:50 -0700 >> From: "sturlamolden" <[EMAIL PROTECTED]> >> Subject: Re: Questions on U

Re: Questions on Using Python to Teach Data Structures and Algorithms

2006-09-28 Thread Brendon Towle
Some of your Lisp translations are subtly off... > Date: 28 Sep 2006 02:49:50 -0700 > From: "sturlamolden" <[EMAIL PROTECTED]> > Subject: Re: Questions on Using Python to Teach Data Structures and > Algorithms > To: python-list@python.org > > If you w

Re: Questions on Using Python to Teach Data Structures and Algorithms

2006-09-28 Thread sturlamolden
efrat wrote: > 1. What exactly is a Python list? If one writes a[n], then is the > complexity Theta(n)? If this is O(1), then why was the name "list" > chosen? If this is indeed Theta(n), then what alternative should be > used? (array does not seem suited for teaching purposes.) A Python list is

Re: Questions on Using Python to Teach Data Structures and Algorithms

2006-09-28 Thread Bruno Desthuilliers
efrat wrote: > Hello, > > I'm planning to use Python in order to teach a DSA (data structures > and algorithms) course in an academic institute. If you could help out > with the following questions, I'd sure appreciate it: (snip) > 2. Suppose I have some file

Re: Questions on Using Python to Teach Data Structures and Algorithms

2006-09-27 Thread Marc 'BlackJack' Rintsch
In <[EMAIL PROTECTED]>, efrat wrote: > 1. What exactly is a Python list? If one writes a[n], then is the > complexity Theta(n)? If this is O(1), then why was the name "list" > chosen? Why not? It has all the methods one expect from an abstract data type "list". It's not the O() behavior but t

Re: Questions on Using Python to Teach Data Structures and Algorithms

2006-09-27 Thread George Sakkis
3. Are there any useful links for Python/DSA education? I found "Data > Structures and Algorithms with Object Oriented Design Patterns" > (http://www.brpreiss.com/books/opus7/html/book.html). It is a fine book, > but it is unsuitable: my students are electrical-engineers, and barely > kn

Re: Questions on Using Python to Teach Data Structures and Algorithms

2006-09-27 Thread bearophileHUGS
ghting and all the shebang. Is there an easy way to do so?< There are many programs that do this, I use a modified version of PySourceColor: http://bellsouthpwp.net/m/e/mefjr75/ Using Python to teach data structures and algorithms to electrical-engineers students: The following personal ideas may s

Questions on Using Python to Teach Data Structures and Algorithms

2006-09-27 Thread efrat
Hello, I'm planning to use Python in order to teach a DSA (data structures and algorithms) course in an academic institute. If you could help out with the following questions, I'd sure appreciate it: 1. What exactly is a Python list? If one writes a[n], then is the complexi

Questions on Using Python to Teach Data Structures and Algorithms

2006-09-27 Thread efrat
Hello, I'm planning to use Python in order to teach a DSA (data structures and algorithms) course in an academic institute. If you could help out with the following questions, I'd sure appreciate it: 1. What exactly is a Python list? If one writes a[n], then is the complexi