Click here to Skip to main content
15,902,447 members
Home / Discussions / Algorithms
   

Algorithms

 
AnswerRe: Linked lists vs. Arrays Pin
Shog925-Apr-07 14:57
sitebuilderShog925-Apr-07 14:57 
GeneralRe: Linked lists vs. Arrays Pin
Leslie Sanford25-Apr-07 15:04
Leslie Sanford25-Apr-07 15:04 
GeneralRe: Linked lists vs. Arrays Pin
Shog925-Apr-07 15:24
sitebuilderShog925-Apr-07 15:24 
GeneralRe: Linked lists vs. Arrays Pin
Leslie Sanford25-Apr-07 15:38
Leslie Sanford25-Apr-07 15:38 
GeneralRe: Linked lists vs. Arrays Pin
Shog925-Apr-07 16:15
sitebuilderShog925-Apr-07 16:15 
GeneralRe: Linked lists vs. Arrays Pin
cp987625-Apr-07 15:42
cp987625-Apr-07 15:42 
GeneralRe: Linked lists vs. Arrays Pin
Chris-Kaiser26-Apr-07 7:16
Chris-Kaiser26-Apr-07 7:16 
GeneralHybrid List source Pin
Chris-Kaiser26-Apr-07 7:24
Chris-Kaiser26-Apr-07 7:24 
public class HybridList: System.Collections.CollectionBase
{
   Hashtable _indicesTable = new Hashtable();

   public int IndexOf(object key)
   {
      if(_indicesTable.ContainsKey(key))
         return (int)_indicesTable[key];
      else
         return -1;
   }
   public int Add(object key, object val)
   {
      int index = List.Add(new DictionaryEntry(key, val));
      _indicesTable[key] = index;
      return index;
   }
   public void Remove(object key)
   {
      if(_indicesTable.ContainsKey(key))
      {
         List.RemoveAt((int)_indicesTable[key]);
         _indicesTable.Remove(key);
         int i = 0;
         foreach(DictionaryEntry entry in List)
         _indicesTable[entry.Key] = i++;
      }
   }
   public DictionaryEntry this[int index]
   {
      get { return ((DictionaryEntry)List[index]); }
   }
   public object this[object key]
   {
      get
      {
         if(_indicesTable.ContainsKey(key))
            return ((DictionaryEntry)List[(int)_indicesTable[key]]).Value;
         else
            return null;
      }
   }
   public ICollection AllKeys
   {
      get { return _indicesTable.Keys; }
   }
	
   protected override void OnClear()
   {
      base.OnClear();
      _indicesTable.Clear();
   }
}


This statement was never false.

GeneralRe: Hybrid List source Pin
Leslie Sanford26-Apr-07 12:35
Leslie Sanford26-Apr-07 12:35 
GeneralRe: Hybrid List source Pin
Chris-Kaiser27-Apr-07 11:51
Chris-Kaiser27-Apr-07 11:51 
GeneralRe: Linked lists vs. Arrays Pin
Stephen Hewitt26-Apr-07 14:02
Stephen Hewitt26-Apr-07 14:02 
AnswerRe: Linked lists vs. Arrays Pin
Stephen Hewitt25-Apr-07 18:02
Stephen Hewitt25-Apr-07 18:02 
QuestionLine intersection Pin
abalbo24-Apr-07 4:38
abalbo24-Apr-07 4:38 
AnswerRe: Line intersection Pin
Arun.Immanuel24-Apr-07 4:56
Arun.Immanuel24-Apr-07 4:56 
QuestionThreshholding ? Pin
Ray Kinsella24-Apr-07 3:19
Ray Kinsella24-Apr-07 3:19 
AnswerRe: Threshholding ? Pin
David Crow24-Apr-07 3:39
David Crow24-Apr-07 3:39 
QuestionLoop Pin
MoustafaS21-Apr-07 9:21
MoustafaS21-Apr-07 9:21 
GeneralRe: Loop Pin
MoustafaS21-Apr-07 10:27
MoustafaS21-Apr-07 10:27 
AnswerRe: Loop Pin
Frank Kerrigan2-May-07 5:45
Frank Kerrigan2-May-07 5:45 
QuestionImage Recognition Algorithm Pin
softwaremonkey19-Apr-07 5:42
softwaremonkey19-Apr-07 5:42 
AnswerRe: Image Recognition Algorithm Pin
Luc Pattyn19-Apr-07 6:24
sitebuilderLuc Pattyn19-Apr-07 6:24 
AnswerRe: Image Recognition Algorithm Pin
Nathan Addy19-Apr-07 7:14
Nathan Addy19-Apr-07 7:14 
AnswerRe: Image Recognition Algorithm [modified] Pin
Rilhas19-May-07 9:43
Rilhas19-May-07 9:43 
Questionhelp genetic algo Pin
clemzug15-Apr-07 1:12
clemzug15-Apr-07 1:12 
AnswerRe: help genetic algo Pin
cp987615-Apr-07 2:31
cp987615-Apr-07 2:31 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.