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.
97 questions
3
votes
2
answers
117
views
Time complexity of a backtracking algorithm
I just solved the following Leetcode problem: All Paths From Source to Target
Here is my solution:
...
0
votes
0
answers
50
views
Relation between C++ concepts and Abstract Algebra
Walter E. Brown's CppCon 2014 talk mentions the fact that "concepts" in C++ are built upon the concepts of abstract algebra. The reference mentions work by A. Stepanov which led me to the ...
-2
votes
1
answer
71
views
Can't understand why my algorithm is not correct [DFS AND BACKTRACKING]
I'm trying to solve the following Leetcode problem: https://leetcode.com/problems/path-sum-ii/description/
This solution I came up with is working: https://pastebin.com/ma3DtU5b
However, I was not ...
1
vote
0
answers
22
views
Transferable skills: From GAP to C++ [closed]
There is mathematical software for an area of mathematics (i.e., group theory), called GAP. For a while now, I have heard the vague statement that it is "based on C++". I don't know what ...
0
votes
0
answers
26
views
Bundle adjustment implementation for stereo matching
My questions is about the implementation of a BA method to calculate the structure of a scene. More specifically, I would like to calculate, from a single iteration and using two images from two ...
2
votes
0
answers
119
views
Algorithm for counting number of subgrids which contain all letters
The problem is as follows (I got this from CSES). Here is the link of the original problem https://cses.fi/problemset/task/3415/:
"You are given a grid of letters. Your task is to calculate the ...
0
votes
0
answers
52
views
each side of the conditional operator is a comma expression
int ival = (ia != 0)
? ix = get_value(), ia[index] = ix
: ia = new int[sz], ia[index] = 0;
In the following example, each side of the conditional operator is a ...
-1
votes
1
answer
75
views
getting data into c++
I am a mathematics student and I want to get data of options from https://bigcharts.marketwatch.com/quickchart/options.asp?symb=SPX into c++ (the strike prices etc.), but is there a way to import it ...
1
vote
1
answer
214
views
How can I construct a threaded binary tree with post-order threads?
I want to construct a threaded binary tree consisting of nine nodes A, B, C, D, E, F, G, H, and I with post-order threads. Each node has five fields, which are LeftThread (true or false), LeftChild (...
0
votes
1
answer
105
views
How to verify no side effects from added code in C++?
I am currently working on a C++ project where I've introduced some new code to extend its functionality. However, it is very important to ensure that this new code does not introduce any side effects ...
0
votes
0
answers
62
views
how to 3d render with only drawing pixels
I have been trying to find ways to display a 3d scene on a screen (specifically 480x240px Vex robotics brain). The only ways that I can draw to the screen is with drawing individual pixels or with ...
-1
votes
1
answer
182
views
Accuracy of Digit Recognition with Template Matching
I have designed a C++ program to recognize the digits on an ID card based on OpenCV. First I preprocess the ID card image and then segment it based on contours. The segmentation results are as ...
2
votes
2
answers
579
views
Would it be possible to run destructors when aborting a thread?
I had a discussion with a C++ developer on whether aborting a thread causes memory leaks. His opinion on how aborting a thread works was
all destructors of the stack objects of the thread to abort ...
0
votes
1
answer
78
views
time complexity of loops
what is the time complexity of:
for (i = 1; i <= n; i = 2*i)
for (j = 0; j < i; j++)
sum++;
?
I thought it is O(nlogn) since the otter loop ...
0
votes
0
answers
64
views
How to Think About Physical Design of Libraries in C++ When Considering the Deliverable's API?
Since design ideas, and even the concept of Physical Design (exactly where you put your files), are such a broad topic, may I give a definite example and ask for feedback on the example?
Suppose you ...