So, I'm using boolean matrices whose dimension is usually a couple dozen to a couple hundred, they are usually quite sparse (just some 2-4 non-zeros in most rows and columns) and my runtime is heavily dominated by their multiplication.
What datastructure suits best for speeding up multiplication under these circumstances?
Currently I'm...
I have a mutable HashMap and would like to use it like a default-dictionary. The obvious method appears to be to use getOrElse and provide the default value each time as a second value. However this seems a little inelegant in my use case since the default value doesn't change.
var x = HashMap(1 -> "b", 2 -> "a", 3 -> "c")
println(x.ge...
I wrote a hashmap in C# as a self study exercise. I wanted to implement chaining as a collision handling technique. At first I thought I'd simply use GetHashCode as my hashing algorithm, but I quickly found that use the numbers returned by GetHashCode would not always be viable (size of the int causes a out of mem if you want to index an...
Hi,
can i get the link to Quick look up of data structures..
...
Hello,
As I am in my starting career year in software development (C++ & C#) I now see my flaws and what I miss in this sphere. Because of that I came into some conclusions and made myself a plan to fill those gaps and increase my knowledge in software development. But the question I stumbled upon after making a tasks which I need to do...
I could really use some good feedback on best practices / insight on whether it is better to put things in the database, or build an array. Take for example you have the suits of cards:
$suits = array('clubs', 'spades', 'hearts', 'diamonds');
The array could change in the future, but not very frequently if at all. Now these suits are ...
Hi friends,
I had an internship interview last week and I was given a question regarding searching for a particular string in a large database. I was totally clueless about it during the interview though I just gave a reply the"multi-level hashing" as that was the only hin I knew which had the best time efficiency, After a bit googling I...
Suppose I have a randomly generated string s=t&^%JHGgfdteam*&HGEdfg, what is the best approach to count the number of English words in that string? (English words as defined in some dictionary file). Obviously brute-force is not a good idea... would a suffix-tri e work? Binary search? Notice that in the case of s, there are two words: "t...
Hi,
please post the possible data structure interview Questions and answers..
it will be helpfull for all who reffers this post.
Thanks
...
I get the concept behind a trie. But I get a little confused when it comes to implementation.
The most obvious way I could think to structure a Trie type would be to have a Trie maintain an internal Dictionary<char, Trie>. I have in fact written one this way, and it works, but... this seems like overkill. My impression is that a trie sh...
Can any one suggest a book on data structures and algorithms that a programmer needs to cover.
...
What kind of problems on graphs is faster (in terms of big-O) to solve using incidence matrix data structures instead of more widespread adjacency matrices?
...
I have implemented an AVL tree in C# whose insertion matrix is as follows
Number of Elements Time taken to insert (sec)
------------------------------------------------------
10 0.067
100 0.073
200 0.112
500 0.388
900 ...
I am storing a relatively small amount (perhaps may be larger in the future) and then searching it but this is proving to be a bit of a bottleneck in my project.
To expand I have up to a few thousand rows and a few columns. I wish to be able search with the ability to specify a simple match with match all wildcards for any element. All ...
From birth I've always been taught to avoid nested arrays like the plague for performance and internal data structure reasons. So I'm trying to find a good solution for optimized multidimensional data structures in Ruby.
The typical solution would involve maybe using a 1D array and accessing each one by x*width + y.
Ruby has the abili...
Any idea how could I implement a Trie in a non-OO way, i.e. only using arrays? The idea is that it would store some good amount of elements, and the OO approach would be too heavy for my case as it is to be used in a J2ME app, where memory is a concern.
Thanks!
...
Okey, so this is my problem.
I have a page structure saved into a mysql db.
Like this:
Page 1
- SubPage 1.1
- - SubPage 1.1.1
- - - SubPage 1.1.1.1
- - - SubPage 1.1.1.2
- - SubPage 1.1.2
- SubPage 1.2
- SubPage 1.3
Page 2
Page 3
The structure can have endless pages and sub pages. All pages have a field called "url" and "childof". "ch...
Is there any good file based key->value data-structure available in c++.
similar to std::map(template based) with a insert/delete/get of O(logn).
...
hi guys i am new so i am sure you will help
i have some trouble with skip list here is code
#include <stdio.h>
#include<stdlib.h>
#include<time.h>
#include <string.h>
#define P 0.5
#define MAX_LEVEL 6
struct sn{
int value;
struct sn **forward;
};
typedef struct sn skipnode;
typedef struct{
skipnode *...
Hi,
I need some help with decide what is the best solution and how should be created system that has dynamic structures.
The structure look something like this, that we have an process that contain various number of parameters that can be in different type and those parameter are represented in individual test. Whole that can be conf...