dynamic list

1998-11-12 Thread Leon Breedt
hi i'm currently using a dynamically resized array to store a list of structs. its working nicely, what i want to know is this: are there any things i should be careful for, when using a pointer to an array? it seems much easier to me to use an array that i resize dynamically, than use a

Re: dynamic list

1998-11-12 Thread Renato
l would not recommend an fixed sized array for your implementation, as deleting a member from the middle will involve shuffle shiffting of elements (assuming you are keeping the list sorted to enable a binary search to take place). Why not use something like a binary tree: You can then include

Re: dynamic list

1998-11-12 Thread Leon Breedt
On Fri, Nov 13 1998, Renato spake thus: Why not use something like a binary tree: You can then include some extra code to enable your tree to perform rotations ie res-balck tree. this will enable your tree to use a binary search method and guarantee O(logN) search insert times. l have only

Re: dynamic list

1998-11-12 Thread Leon Breedt
On Thu, Nov 12 1998, Glynn Clements spake thus: Shouldn't the declaration just be pwlistentry *PasswordList = NULL; quite possibly, i got that declaration from the program 'cdecl', by giving it the input: declare PasswordList as pointer to array 20 of struct pwlistentry and then it

Re: dynamic list

1998-11-12 Thread Glynn Clements
Leon Breedt wrote: Shouldn't the declaration just be pwlistentry *PasswordList = NULL; quite possibly, i got that declaration from the program 'cdecl', by giving it the input: declare PasswordList as pointer to array 20 of struct pwlistentry and then it gave me the declaration