data-structures Questions
6
Solved
Sorry for the noob question I'm just a little confused.
If I have an array of structures in main that I want to pass to a function:
struct MyStruct{
int a;
int b;
char c;
mayarray[5];
};
MyS...
Gnomon asked 31/8, 2010 at 21:18
10
I need a data structure that can sort objects by the float keys they're associated with, lowest first. The trouble is that the keys represent cost so there are often duplicates, I don't care about ...
Foresail asked 3/8, 2012 at 18:30
4
I have 200 sets of about 50,000 unique integers in the range 0 to 500,000 I need to map to another small value (pair of ints, values are unrelated so no on-demand calculation).
I tried using std::...
Ordinarily asked 30/7, 2016 at 16:33
20
Python includes the heapq module for min-heaps, but I need a max-heap. What should I use for a max-heap implementation in Python?
Supereminent asked 23/3, 2010 at 15:58
4
Solved
In Algorithm Design Manual, page 178 describes some properties of Graph, and one of them is embedded and Topological:
Embedded vs. Topological
A graph is embedded if the vertices and
edges are ass...
Ennui asked 4/4, 2012 at 11:31
3
I'm very new to C++, and I was wondering if there was a way to make a min heap in C++ from the standard library.
Plutocrat asked 7/5, 2010 at 5:29
7
Solved
There is also a counterpart which is called density array. What does this mean? I have done some search, but didn't get accurate information.
Rosati asked 4/8, 2011 at 6:39
5
Solved
I'm Learning data structure with javascript
and my focus now on how to implement deque?
Edite: from comments below I get useful directions on how to implement deque based array. Is there a dir...
Diatropism asked 4/2, 2020 at 7:56
2
Solved
This is a problem I came across frequently and I'm searching a more effective way to solve it. Take a look at this pics:
Let's say you want to find the shortest distance from the red point to a ...
Amateur asked 27/6, 2014 at 22:27
4
Solved
I am trying to understand the X and Y Fast Trie data structures and it's not clear why that structures are not used in large database since their asymptotic complexity is less than Log(N).
In cases...
Werewolf asked 13/10, 2014 at 17:34
7
Solved
I've got a perfect binary tree that's enumerated the post-order way. An example of such tree would be
15
7 14
3 6 10 13
1 2 4 5 8 9 11 12
The size of the tree is known to me. I'm looking for...
Perforated asked 5/12, 2013 at 16:27
5
I use GoogleColab to test data stuctures like chain-hashmap,probe-hashmap,AVL-tree,red-black-tree,splay-tree(written in Python),and I store very large dataset(key-value pairs) with these data...
Fortuity asked 20/2, 2018 at 6:56
6
Solved
I have read through some tutorials about two common data structure which can achieve range update and query in O(lg N): Segment tree and Binary Indexed Tree (BIT / Fenwick Tree).
Most of the exampl...
Sphygmoid asked 30/9, 2016 at 8:53
4
Solved
B-Tree Definition
they use the 'order' term in :
According to Knuth's definition, a B-tree of order m is a tree which satisfies the following properties:
1. Every node has at most m children.
......
Buffybuford asked 4/3, 2015 at 3:51
5
Solved
Reference:
I was asked this question @MS SDE interview, 3rd round. And it's not a homework problem. I also gave it a thought and mentioning my approach below.
Question:
Modify a BST so that it bec...
Transpierce asked 22/12, 2012 at 9:31
8
Solved
I'm making a program which the user build directories (not in windows, in my app) and in these folders there are subfolders and so on; every folder must contain either folders or documents. What is...
Genaro asked 1/11, 2008 at 17:28
22
Solved
Has anyone already implemented a circular buffer in JavaScript? How would you do that without having pointers?
Glaydsglaze asked 17/10, 2009 at 20:29
3
Solved
The queue — A synchronized queue class simply states that
there are fewer functions allowed with SimpleQueue.
I need very basic queue functionality for a multithreading application, would it ...
Valenta asked 5/6, 2020 at 20:9
2
Solved
I'm looking for a built-in Python data structure that can add a new element, remove an existing element, and choose a random element, all in better than O(n) time.
I was hoping that set could do t...
Fanestil asked 13/4, 2013 at 22:6
6
Solved
If a person learns data-structure and algorithm in one programming language does it needs to learn other language's data-structure and algorithm ?
As i am about to start a book Data-structure and a...
Serrano asked 3/10, 2014 at 15:15
6
Solved
I understand how to delete the root node from a max heap but is the procedure for deleting a node from the middle to remove and replace the root repeatedly until the desired node is deleted?
Is O...
Urus asked 2/1, 2012 at 20:38
4
Solved
I came across an interview question that went like this:
There are factories in an area which produce a pollutive gas and filters are to be installed at each factory to reduce the pollution. Each ...
Guarantor asked 15/5, 2022 at 13:12
3
Solved
Fenwick tree is a data-structure that gives an efficient way to answer to main queries:
add an element to a particular index of an array update(index, value)
find sum of elements from 1 to N find...
Credenza asked 29/6, 2015 at 1:14
5
Solved
I'm working in linked lists in Java, so I'm trying to grasp the concept of a single linked list.
head -> 12 -> 34 -> 56 -> null
head.next would be 12 (also the same as node1). However...
Centigrade asked 11/2, 2011 at 20:30
3
Solved
First please note that this question is NOT asking about MST, instead, just all possible spanning trees.
So this is NOT the same as finding all minimal spanning trees or All minimum spanning trees...
Commutate asked 2/3, 2014 at 13:54
© 2022 - 2024 — McMap. All rights reserved.