Showing posts with label Data Structure. Show all posts
Showing posts with label Data Structure. Show all posts

15 December 2010

Algorithm optimization notes

Today I was working on optimizing an alpha-beta gaming algorithm, and I found a few things along the way:
  • Object creation can be time consuming and dragging down your algorithm performance. So, think twice when object creation can be avoided.
  • When you are implementing an algorithm, the first thing is to make it work correctly, the second thing is to spot the heavy-weight routine or code sections that requires dense computation.
  • Think twice about the use of data structure. Often times it is the wrong data structure you use that slows down the program execution.

12 June 2010

B-Tree

Or some variants of B-tree: B+ - tree.
It is particularly useful for database systems or file systems. The purpose of using B-trees is it can minimize the frequency of disk accesses. Apple's HFS+ and Microsoft's NTFS filesystem use B-trees.