This week's book giveaway is in the OCAJP forum.
We're giving away four copies of Programmer's Guide to Java SE 8 Oracle Certified Associate (OCA) and have Khalid A Mughal & Rolf W Rasmussen on-line!
See this thread for details.
Win a copy of Programmer's Guide to Java SE 8 Oracle Certified Associate (OCA) this week in the OCAJP forum!
  • 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: 13071
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