10-08-2024, 10:26 AM
Hi Terry, was actually on the internet searching multiple examples of arrays and Dictionary was commented as being in C++
You know b+, when I first read the word Dictionary and did a little read up on it, it seemed to be just a 2 dimensional array exactly like you have laid out in your code. It would appear, as DSMAN has described its' inner workings, has a superior "constant-time lookup, insert and delete. I'm imagining this would suggest a 2 dimensional array would have a serial lookup (ie if I want to find an entry it would go through the stored data one item at a time until it finds the search item) whereas the same Dictionary is more like a random access (ie it goes directly to the search item)
I like the order I get with a 2 dim array to build a data base but seems the Dictionary approach would be great to maintain a data base. I haven't worked with linked lists or hash tables (old dog new trickisim) but I have seen examples of them on this forum (or maybe the old forum).
Thanks for the info guys
You know b+, when I first read the word Dictionary and did a little read up on it, it seemed to be just a 2 dimensional array exactly like you have laid out in your code. It would appear, as DSMAN has described its' inner workings, has a superior "constant-time lookup, insert and delete. I'm imagining this would suggest a 2 dimensional array would have a serial lookup (ie if I want to find an entry it would go through the stored data one item at a time until it finds the search item) whereas the same Dictionary is more like a random access (ie it goes directly to the search item)
I like the order I get with a 2 dim array to build a data base but seems the Dictionary approach would be great to maintain a data base. I haven't worked with linked lists or hash tables (old dog new trickisim) but I have seen examples of them on this forum (or maybe the old forum).
Thanks for the info guys