Questions tagged [c++]

Programming questions are off-topic here. Do not ask questions about how to write code in C++. However, conceptual questions about computer science are more appropriate. See our help center for the scope of this site.

16 questions with no upvoted or accepted answers
Filter by
Sorted by
Tagged with
3
votes
0answers
23 views

Subtype Check with Type DAG

Trying to understand how compiler/static-type-checker checks for subtyping, I run into 2 problems. 1. Reachability in DAG Since both Python/C++ support multiple inheriatnce, the types can be ...
3
votes
0answers
67 views

How to detect when to use radix sort in runtime

I'm implementing a stable integer sorting algorithm, I've chosen radix sort. I've tested LSD vs MSD implementation, wrote MSD/LSD hybrid implementation to reduce bandwidth pressure. The repo is here: ...
3
votes
0answers
93 views

Summary of types of equivalence and equality in type theory, with notations and examples

Coming from non-computer science background, I am trying to understand the different types of equivalence and equality usually used in type theory. Ideally, I am looking for clear definitions and ...
2
votes
0answers
80 views

Implementing a linear programming feasibility test in 3D

I have a little problem which requires determining if a system of linear inequalities in 3D is infeasible. The constraints (or oriented planes) are added one by one, so there is an opportunity to stop ...
1
vote
0answers
47 views

finding max element in a min-max heap structure

I am trying to implement min-max heap structure A min-max heap is a data structure that is identical to a binary heap, but the heap-order property is that for any node, X, at even depth, the element ...
1
vote
0answers
574 views

Minimum no of swaps to be done in an array such that, no two adjacent elements are same

Given an array of size n, find minimum number of swaps required, so that no two adjacent elements are equal. For ex- n = 6, a[] = {1, 1, 5, 2, 5, 5}, answer = 1, ( swap a[0] with a[4] or a[5] ) n = 8,...
1
vote
1answer
51 views

Is the Jacobian matrix calculation process correctly on this energy function?

When I implemented the paper Dynamic Fusion published in 2015 CVPR, I came into the trouble with how to solve the energy function: $$E(W_t, V, D_t, \mathcal{E}) = \text{Data}(W_t, V, D_t) + λ\text{Reg}...
1
vote
0answers
238 views

Unordered data structure with fast insertion, deletion, and iteration

So, I need a data structure that would support the following operations: Add an element to the structure and get some "handle" for that element Retrieve an element by a handle Remove an ...
1
vote
0answers
87 views

Generate an AST from an indefinite grammar and logic

As said in the title, I have to generate an AST from a grammar and logic (or a"syntax" if you prefer). This grammar and syntax are both indefinite in the program, meaning that it is the user (a ...
0
votes
0answers
14 views

Which GOP's (M and N) values can be used in the video encoded with any MPEG?

I faced the problem with defining either GOP is right or not after parsing the MXF container. I checked the actual GOP value using FFProbe and MediaInfo and these values differ (E.g. M3N15) from which ...
0
votes
0answers
37 views

Solving course scheduling with prerequisite problem

How should one go about this kind of problems? I'm supposed to use a graph structure for this. Say I have a file containing a couple of courses with their prerequisites. I have to organize the ...
0
votes
0answers
63 views

Bin packing problem using bit masking

We have n box and an array of weights, where weight of ith box is given by arr[i]. We have a container which can carry a maximum weight of w. Now we have to find minimum number of containers required ...
0
votes
0answers
28 views

What is meant by the statement "Data is inactive but information is active"?

I came across the statement "data is inactive but information is active" while reading differences between data and information. What is meant by this statement?
0
votes
0answers
12 views

parallelized data structure

I'm searching a data structure that supports O(1) concurrent insertions (thread number is known in advance) and iteration over its elements (insertion order doesn't need to be preserved). While one ...
0
votes
0answers
27 views

How to Tokenize a String and Save Each Substring Separately (Independent Names for Each Substring)

I am given two files one with the name of person and the location that they are from (Evan Lloyd|Brownsville) and one with the name and salary (Evan Lloyd|58697) (the line number that you find the ...
0
votes
0answers
128 views

Given n strings, how to output their order after k phases of the radix sort (huge constraints)?

Disclaimer This is not from an ongoing contest, this is from my course of ITMO on edx.org, which is a paid code so I cannot give you a direct link to the course. Problem You are given $\...