• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

I need data structure advice

 
Nikos Stavros
Ranch Hand
Posts: 243
Python
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello, I want some advice on how to organise this.

I have 8 channels, each channel has 300 toggle points, each toggle points has 7 bytes of data. I was thinking of doing this



or alternatively creating a class called togglePoint and creating lots of instances of this.

 
Mr. C Lamont Gilbert
Ranch Hand
Posts: 1170
Eclipse IDE Hibernate Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Create the class version.
 
William Brogden
Author and all-around good cowpoke
Rancher
Posts: 13058
6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I agree with C. Lamont - with the other version you build many more objects than necessary. The only time the byte[][][] would be preferable would be if the data was quite sparse and irregular in data size.
Bill
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic