Best way to remove an entry from a hash table
What is the best way to remove an entry from a hashtable that uses linear probing? One way to do this would be to use a flag to indicate deleted elements? Are there any ways better than this? ...
What is the best way to remove an entry from a hashtable that uses linear probing? One way to do this would be to use a flag to indicate deleted elements? Are there any ways better than this? ...
I need an algorithm to store a key/value pair, where the key is an Int64. I'm currently using a sorted IntList (same as a TStringList, but stores int64s). This gives me O(log n) for search, Insert and delete operations. Since I don't ever need the items sorted, this is a little inefficient. I need some kind of hashtable for O(1) operatio...
I am extremely new at php and I was wondering if someone could help me use either a for or while loop to create an array 10 elements in length ...
typedef struct { nat id; char *data; } element_struct; typedef element_struct * element; void push(element e, queue s) { nat lt = s->length; if (lt == max_length - 1) { printf("Error in push: Queue is full.\n"); return; } else { s->c...
I want to build two-dimentional array of strings where length of one dimention is 2. Similar to this string[,] array = new string[,] { {"a", "b"}, {"c", "d"}, {"e", "f"}, {"g", "h"} } Doing List<string[]> list = new List<string[]>(); list.Add(new string[2] {"a", "b"}); list.Add(new string[2] {"c", "d"}); list.Add(new...
[former title: Is there a way to force a relationship structure on a tag-based organizational methodology?] I have some entities, and they have a series of attributes. Some of the attributes affect what other attributes the entity can have, many of the attributes are organized into groups, and occasionally entities are requited to have ...
Title says it mostly. I want to add a simple extension method to the base Dictionary class in C#. At first I was going to name it Pop(TKey key), kind of like the Stack method, but it accepts a key to use for lookup. Then I was going to do Take(TKey key), but it coincides with the LINQ method of the same name...and although C# 3.0 lets y...
I want to store a very large amount of vector data on a server and only poll the parts I need at a given point... This shouldn't be a problem. Is there any way to take a vector file like an svg file and import it into a database? I could always write an svg parser to import it into my database, but is there any standard way of doing th...
I want to learn more about "trie" data structures. I've read about them on Wikipedia but I'm still confused. What is the most common use? Auto-complete in the address bar of a web browser... or? Cheers! ...
I am looking for a way to quickly compare the state of a database table with the results of a Web service call. I need to make sure that all records returned by the Web service call exist in the database, and any records in the database that are no longer in the Web service response are removed from the table. I have to problems to sol...
The DOM NodeList (as returned e.g. by element.getElementsByTagName) is an interesting object, in that it is not a snapshot, but reflects changes to the document made after you have created the NodeList. I was wondering how one would implement such a collection: Completely lazy evaluation must be horribly slow, but keeping a cached vers...
Hey guys, I'm trying to find the definition of a binary search tree and I keep finding different definitions everywhere. Some say that for any given subtree the left child key is less than or equal to the root. Some say that for any given subtree the right child key is greater than or equal to the root. And my old college data struc...
In most of programming languages, we preferred using a dictionary over a hashtable . What are the reasons behind it? ...
Description | A Java program to read a text file and print each of the unique words in alphabetical order together with the number of times the word occurs in the text. The program should declare a variable of type Map<String, Integer> to store the words and corresponding frequency of occurrence. Which concrete type, though? TreeMap<St...
I'm looking for material on persistent data structures that can be used to implement a relational model. Persistence in the meaning of immutable data structures. Anyone know of some good resources, books, papers and such? (I already have the book Purely Functional Data Structures, which is a good example of what I'm looking for.) ...
We all, as programmers, have something that we really like and always when we are trying to solve a problem we would like to solve it on our personal choice of programming language/algorithm. But the question that I've chatted with other developers at work about, was "Which is your favorite data structure" so I've met developers who was...
I am currently teaching myself about various data strutures and am a little frustrated with the various types of trees. I can understand the purpose of organizing something into binary search trees but don't see any practical application of multiway search trees. Can someone please give some examples of problems they've implemented using...
Essentially, I have to get a flat file into a database. The flat files come in with the first two characters on each line indicating which type of record it is. Do I create a class for each record type with properties matching the fields in the record? Should I just use arrays? I want to load the data into some sort of data structure...
Are there any good libraries (preferably with commented source) for standard datastructures (Linked list, array list, queue, stack etc.) for x86 (or others) in Assembler ? I don't like to reinvent (and debug !) the wheel.... ...
I'm writing a simple IDictionary abstraction in C# that wraps a Dictionary<K, ICollection<V>>. Basically, it maps multiple values to one key. I can't decide whether to remove a key and its empty list when the last item in a values list is removed, or leave it (to avoid instantiating a new collection if the key is reused) and do checks ...