data-structures Questions
2
Solved
Are Fibonacci heaps used in practice anywhere? I've looked around on SO and found answers to related questions (see below) but nothing that actually quite answers the question.
There are good imp...
Keeper asked 11/6, 2015 at 13:46
14
Solved
Given the current node, how can I find its previous node in a Singly Linked List. Thanks. Logic will do , code is appreciated. We all know given a root node one can do a sequential traverse , I wan...
Connective asked 25/8, 2011 at 23:47
6
Solved
My data is structured in a way that I ended up creating a nested dictionary in my design like:
my_dict = {"a": {"b": {"c":"I am c"}}}
my_dict["a"]["b"]["c"]
Is it usual! or we have some other b...
Diplomacy asked 19/2, 2010 at 18:41
7
Solved
Just now I read some posts about List<T> vs LinkedList<T>, so I decided to benchmark some structures myself. I benchmarked Stack<T>, Queue<T>, List<T> and LinkedList&l...
Kanara asked 3/11, 2012 at 16:48
5
Solved
This problem was asked to me in Amazon interview -
Given a array of positive integers, you have to find the smallest positive integer that can not be formed from the sum of numbers from array.
Ex...
Conjunctiva asked 12/1, 2014 at 17:19
4
Deque ("doubled-ended queue") operations, en-queue and de-queue are possible from both ends.
How do to I define ADT operations for deque using 2 stacks?
The implementation should also tak...
Landmeier asked 9/9, 2012 at 7:27
6
I don't understand difference between a double-ended and doubly-linked list.
What is the major difference between the two?
Ellswerth asked 4/2, 2015 at 19:24
4
Solved
I have a byte buffer of unknown size, and I want to create a local struct variable pointing to the memory of the beginning of the buffer. Following what I'd do in C, I tried a lot of different thin...
Marindamarinduque asked 28/2, 2017 at 2:23
7
Solved
In Javascript, if I have an array of arrays representing a matrix, say
x = [
[1,2,3,4],
[5,6,7,8],
[9,10,11,12]
];
summing it "horizontally" is easy and can be done like
x.map(functio...
Farthest asked 21/8, 2015 at 11:59
7
Solved
I use LINQ to Objects instructions on an ordered array.
Which operations shouldn't I do to be sure the order of the array is not changed?
Incogitant asked 15/10, 2008 at 12:20
2
Solved
What is the meaning of Value semantics and Pointer semantics in Go? In this course, the author used to mention many times about above terms when explaining internals of arrays and slices which I co...
Hafler asked 10/7, 2018 at 11:44
4
Solved
I have a list of objects (undirected edges) like below:
pairs = [
pair:["a2", "a5"],
pair:["a3", "a6"],
pair:["a4", "a5"],
pair:["a7", "a9"]
];
I need to find all components (connected nod...
Claresta asked 20/2, 2014 at 7:11
31
Solved
What are the stack and heap?
Where are they located physically in a computer's memory?
To what extent are they controlled by the OS or language run-time?
What is their scope?
What determines their...
Extricate asked 17/9, 2008 at 4:18
8
The heap property says:
If A is a parent node of B then the key of node A is ordered with
respect to the key of node B with the same ordering applying across
the heap. Either the keys of pare...
Rikkiriksdag asked 14/8, 2014 at 23:47
3
I have been having trouble finding an example of what use cases are suitable for Vector Clocks and Version Vectors, and how they might differ. I understand that they largely work in the same way, w...
Albinus asked 24/10, 2019 at 15:20
4
Solved
I have
a few million records in a database that
reference each other (a directed acyclic graph). There are direct references (A -> B) and indirect references (if A -> B and B -> C, then A...
Saddleback asked 18/1, 2023 at 17:38
8
Solved
I want to check whether the "user" key is present or not in the session hash. How can I do this?
Note that I don't want to check whether the key's value is nil or not. I just want to check whether...
Territorialism asked 24/12, 2010 at 22:2
8
Solved
Are there any well-known libraries in Java for sparse bit vectors?
(And are there guidelines for how sparse is useful to use them vs. java.util.BitSet?)
Inoculate asked 14/6, 2010 at 20:57
3
Solved
I was reading about skip lists and MemSQL and was wondering why skip lists are not more widely used in databases? Are there any major disadvatages to using skiplists?
Suu asked 17/2, 2014 at 12:14
9
Solved
I need a map in which my key should be based on 3 columns, say C1, C2, C3. C1 has highest priority. C2 has one less than C1 and C3 has one less than C2.
How do i create key in the map such that if...
Verbalize asked 21/3, 2013 at 6:2
11
Solved
Building on this question, is there a simple solution for having a multi-key dictionary where either key individually can be used to identify the value?
ie.
MultikeyDictionary<TKey1, TKey2, TV...
Dispermous asked 23/7, 2009 at 13:54
5
I'm looking for a .Net implementation of a multiset. Can anyone recommend a good one?
(A multiset, or bag, is a set that can have duplicate values, and on which you can do set operations: intersec...
Audet asked 8/4, 2010 at 5:3
5
Solved
The image above is from "Wikipedia's entry on AVL trees" which Wikipedia indicates is unbalanced.
How is this tree not balanced already?
Here's a quote from the article:
The balance factor of...
Grooms asked 23/10, 2008 at 18:20
5
Solved
In what situations should I use each kind of list? What are the advantages of each one?
Scalable asked 3/4, 2009 at 3:13
5
Solved
I have two lists
a = [1,2,3]
b = [9,10]
I want to combine (zip) these two lists into one list c such that
c = [(1,9), (2,10), (3, )]
Is there any function in standard library in Python to do...
Baize asked 3/7, 2012 at 20:51
© 2022 - 2024 — McMap. All rights reserved.