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 are easily implemented

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. Any volunteer? :-)

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.

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 be

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

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 regarding object

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 Emil Lenngren
Rather points (vertices) on a map and roads connecting them (edges). 2012/5/23 Demosthenes Koptsis demosthen...@gmail.com 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

[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

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

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::setGB_VARIANT_VALUE internally. Implementing them in

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 here

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

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 structures

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 gambas

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

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... see a full

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.

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