Re: [Gambas-user] Data Structures like C++

2012-05-24 Thread tobi
On Thu, 24 May 2012, Bruce wrote: > On Thu, 2012-05-24 at 11:07 +0200, tobi wrote: > > > (Completely giving up anything I knew about binary trees now, because it > > wasn't much and it wasn't > > even from a book): > > You said that you can traverse from any node in the tree. > No, any node can

Re: [Gambas-user] Data Structures like C++

2012-05-24 Thread Bruce
On Thu, 2012-05-24 at 11:07 +0200, tobi wrote: > (Completely giving up anything I knew about binary trees now, because it > wasn't much and it wasn't > even from a book): > You said that you can traverse from any node in the tree. No, any node can be considered as a root for a subtree. Anynode.

Re: [Gambas-user] Data Structures like C++

2012-05-24 Thread tobi
On Thu, 24 May 2012, Bruce wrote: > On Wed, 2012-05-23 at 17:19 +0200, tobi wrote: > > On Thu, 24 May 2012, Bruce wrote: > > > On Mon, 2012-05-21 at 22:25 +0200, Benoît Minisini wrote: > > > > > > > * Tree > > > > * Graph > > > > > > > > Native implementation of that would be interesting. > > > >

Re: [Gambas-user] Data Structures like C++

2012-05-24 Thread Bruce
On Wed, 2012-05-23 at 17:19 +0200, tobi wrote: > On Thu, 24 May 2012, Bruce wrote: > > On Mon, 2012-05-21 at 22:25 +0200, Benoît Minisini wrote: > > > > > * Tree > > > * Graph > > > > > > Native implementation of that would be interesting. > > > > > > Any volunteer? :-) > > > > > I think trees

Re: [Gambas-user] Data Structures like C++

2012-05-23 Thread Emil Lenngren
Rather points (vertices) on a map and roads connecting them (edges). 2012/5/23 Demosthenes Koptsis > may i ask a question, > > graphs have some algorithms such shortest path as i read, > my question is, a graph could be used for a GPS system to represent > points on a map or it is something diff

Re: [Gambas-user] Data Structures like C++

2012-05-23 Thread Demosthenes Koptsis
may i ask a question, graphs have some algorithms such shortest path as i read, my question is, a graph could be used for a GPS system to represent points on a map or it is something different ? -- Live Security Virtual

Re: [Gambas-user] Data Structures like C++

2012-05-23 Thread tobi
On Thu, 24 May 2012, Bruce wrote: > On Mon, 2012-05-21 at 22:25 +0200, Benoît Minisini wrote: > > > * Tree > > * Graph > > > > Native implementation of that would be interesting. > > > > Any volunteer? :-) > > > I think trees are easily implemented directly in gambas using Emil's > suggestions

Re: [Gambas-user] Data Structures like C++

2012-05-23 Thread Bruce
On Mon, 2012-05-21 at 22:25 +0200, Benoît Minisini wrote: > * Tree > * Graph > > Native implementation of that would be interesting. > > Any volunteer? :-) > I think trees are easily implemented directly in gambas using Emil's suggestions regarding object references as a general n-tree can be i

Re: [Gambas-user] Data Structures like C++

2012-05-21 Thread Emil Lenngren
Usual implementations of trees does not have restrictions on number of children. Each node are allocated separately. They use to contain pointers to the left and right children, and maybe to the parent as well. I don't see any reason why Graphs should be implemented as a special Collection. There

Re: [Gambas-user] Data Structures like C++

2012-05-21 Thread Emil Lenngren
Sometimes linked list are used to manipulate data in the middle of the list (insertions, removals), then arrays are too slow. O(1) vs O(n). However, a linked list is very easy to implement in Gambas, using object references. Sometimes (ordered) sets are used by the fact that they are ordered. Then

Re: [Gambas-user] Data Structures like C++

2012-05-21 Thread tobi
On Mon, 21 May 2012, Benoît Minisini wrote: > Le 21/05/2012 21:51, Demosthenes Koptsis a écrit : > > Basic languages have simple data structures like vars and arrays but > > other languages > > like c++ with the help of pointers can have advanced data structures > > like containers etc... > > > > s

Re: [Gambas-user] Data Structures like C++

2012-05-21 Thread Demosthenes Koptsis
Στις 21/5/2012 23:25, ο/η Benoît Minisini έγραψε: > Le 21/05/2012 21:51, Demosthenes Koptsis a écrit : >> Basic languages have simple data structures like vars and arrays but >> other languages >> like c++ with the help of pointers can have advanced data structures >> like containers etc... >> >> s

Re: [Gambas-user] Data Structures like C++

2012-05-21 Thread Benoît Minisini
Le 21/05/2012 21:51, Demosthenes Koptsis a écrit : > Basic languages have simple data structures like vars and arrays but > other languages > like c++ with the help of pointers can have advanced data structures > like containers etc... > > see a full list here > http://en.wikipedia.org/wiki/List_of

Re: [Gambas-user] Data Structures like C++

2012-05-21 Thread Demosthenes Koptsis
Στις 21/5/2012 23:05, ο/η tobi έγραψε: > On Mon, 21 May 2012, Demosthenes Koptsis wrote: >> Στις 21/5/2012 22:56, ο/η tobi έγραψε: >>> On Mon, 21 May 2012, Demosthenes Koptsis wrote: Basic languages have simple data structures like vars and arrays but other languages like c++ with th

Re: [Gambas-user] Data Structures like C++

2012-05-21 Thread Demosthenes Koptsis
Στις 21/5/2012 22:59, ο/η Emil Lenngren έγραψε: > Hash tables and arrays are already implemented. > > The most important missing ones are Multimaps, Sets, Multisets, Linked > lists, Deques. > It should be quite easy to write c++ wrappers and put them in a component. Can they be implemented as gamb

Re: [Gambas-user] Data Structures like C++

2012-05-21 Thread tobi
On Mon, 21 May 2012, Demosthenes Koptsis wrote: > Στις 21/5/2012 22:56, ο/η tobi έγραψε: > > On Mon, 21 May 2012, Demosthenes Koptsis wrote: > >> Basic languages have simple data structures like vars and arrays but > >> other languages > >> like c++ with the help of pointers can have advanced data

Re: [Gambas-user] Data Structures like C++

2012-05-21 Thread Demosthenes Koptsis
Στις 21/5/2012 22:59, ο/η Emil Lenngren έγραψε: > Hash tables and arrays are already implemented. > > The most important missing ones are Multimaps, Sets, Multisets, Linked > lists, Deques. > It should be quite easy to write c++ wrappers and put them in a component. > For example, a Set can use a s

Re: [Gambas-user] Data Structures like C++

2012-05-21 Thread Demosthenes Koptsis
Στις 21/5/2012 22:56, ο/η tobi έγραψε: > On Mon, 21 May 2012, Demosthenes Koptsis wrote: >> Basic languages have simple data structures like vars and arrays but >> other languages >> like c++ with the help of pointers can have advanced data structures >> like containers etc... >> >> see a full list

Re: [Gambas-user] Data Structures like C++

2012-05-21 Thread Emil Lenngren
Hash tables and arrays are already implemented. The most important missing ones are Multimaps, Sets, Multisets, Linked lists, Deques. It should be quite easy to write c++ wrappers and put them in a component. For example, a Set can use a std::set internally. Implementing them in Gambas should wor

Re: [Gambas-user] Data Structures like C++

2012-05-21 Thread tobi
On Mon, 21 May 2012, Demosthenes Koptsis wrote: > Basic languages have simple data structures like vars and arrays but > other languages > like c++ with the help of pointers can have advanced data structures > like containers etc... > > see a full list here > http://en.wikipedia.org/wiki/List_of

[Gambas-user] Data Structures like C++

2012-05-21 Thread Demosthenes Koptsis
Basic languages have simple data structures like vars and arrays but other languages like c++ with the help of pointers can have advanced data structures like containers etc... see a full list here http://en.wikipedia.org/wiki/List_of_data_structures i wonder if such data structures can be impl