Welcome, Guest. Please login or register.

Author Topic: My C homework  (Read 14305 times)

Description:

0 Members and 2 Guests are viewing this topic.

Offline SamuraiCrow

  • Hero Member
  • *****
  • Join Date: Feb 2002
  • Posts: 2281
  • Country: us
  • Gender: Male
    • Show all replies
Re: Mel's C homework
« on: February 24, 2007, 04:15:00 PM »
The binary and ternary search trees would be slower than the hash or the trie.  The ternary search tree would be O(log n) time complexity while the trie and hash have typical time complexities of O(1) with the hash degrading to a O(n) as collisions increase.  That said, I'd go with the trie.
 

Offline SamuraiCrow

  • Hero Member
  • *****
  • Join Date: Feb 2002
  • Posts: 2281
  • Country: us
  • Gender: Male
    • Show all replies
Re: Mel's C homework
« Reply #1 on: March 01, 2007, 03:46:07 PM »
Quote

Smack wrote:
Quote
It was faster than the basic char array on my 040. I reasoned that it may well be faster on the 030 but as you say, mileage varies ;-)

Interesting! Why's that? Can the longword memory access be that much faster than the byte memory access?


No...  The '040 has a 4k cache on the die instead of a 256 byte cache.