All Questions
Tagged with algorithms data-structures
176 questions
5
votes
9
answers
3k
views
Methods to increase the amount of data sent in a packet
I have been working on launching high-altitude balloons (HABs, or weather balloons) and I have been using LoRa to enable long-range communication with my balloons. It's been great and pretty reliable, ...
0
votes
0
answers
87
views
What is the Big O notation of modifying an existing element in a heap data structure?
Wikipedia says "increase key" is O(log n) for a binary heap, but it is referring to an internal function. I'm not asking about that: Imagine the data structure had an external/public ...
3
votes
4
answers
2k
views
Iterating through stacks and queues?
Are stacks and queues allowed to be iterated over, conceptually?
It “feels wrong” for some reason but I can't come up with a reason why it would be bad to see through the whole thing that's stacked/...
2
votes
3
answers
204
views
Eliminating combinations based on user input
I am stuck with this particular problem. To give context to the problem, I am developing a mobile app which helps with loading dangerous goods onto a truck. Ignore the size and weight of the dangerous ...
0
votes
0
answers
182
views
Is there a known algorithm for reducing a tree based on a list of its leaves?
For a given, tree-like data structure:
- Alan
- Barbara
- Charlie
- Cecil
- Brian
- Chris
- Candice
- Cohen
- Boromir
- Corcoran
-...
4
votes
1
answer
1k
views
What is the most suitable data structure for IPv4 addresses with intersecting ranges?
Mostly in all routers and operating systems the Longest Prefix Match algorithm is used for searching the trie of IPv4 addresses.
Packet filters like Iptables don't need some special data structure for ...
-1
votes
2
answers
692
views
search message in a conversation like messenger
I want to implement a search feature in my chat application like a messenger, skype, whatsapp has done. What they have done is when we search a word then it would not only show the message with that ...
1
vote
2
answers
484
views
Efficient set method in run length encoded C++ map
I have been designing a C++ class that maps an integer to an integer using a vector. Because there is a lot of repetitive data (for example 11115555666222), I am using a compression scheme where I am ...
7
votes
2
answers
632
views
some misunderstanding in concept of Huffman algorithm
What is difference between Average length of codes and Average length of codewords in Huffman Algorithm? is both the same meaning? I get stuck in some facts:
I see a fact that marked as False:
for a ...
6
votes
4
answers
486
views
Is there an algorithm that performs better than O(n^2) for this unique pair tuple problem?
I'm trying to figure out if it's possible to have an algorithm that solves a certain problem in better than O(n^2) time.
Specifically, I'm looking for an algorithm that, given two lists of two-tuples (...
0
votes
1
answer
124
views
how to store the data for function f(time,length)
I have a function which has discrete time step ,discrete length from origin . These two give height of the function. For example at time 1.2sec , and length 5.5cm from origin height is 10cm. The step ...
0
votes
1
answer
2k
views
Efficient way to find Xor of pairs with given target X in a range 0 to K
I came across a problem: given an array (can be huge 10^8) and an integer, K, find the count of pairs in the array whose Xor equal to each value in the range 0 to K.
eg:
Arr = 1 2 3
K = 2
since K=...
12
votes
2
answers
2k
views
Data structure for multi key range queries
I need a data structure that gives the best performance for multi-key range lookups. I do not need to update/insert/delete. This will be immutable. The use case is in-memory filtering of values over ...
0
votes
0
answers
74
views
Time-indexed "array" of time spans
I have a list of objects that have durations,
ProcedurePart
Start: double
Stop: double
Instructions: string
they occur sequentially after each other:
stepOne stepTwo ...
-3
votes
2
answers
208
views
Recursion + Stack/Queue usage in practical life implementation [closed]
I am very new to Data Structures and Algorithms. I want to use recursion + stack/queue in a grocery store inventory program that I am making. However, I can't come up with any good ways of using ...