Data Structures is the only Pre-requisite. The professor also recommended taking a class on computer architecture, first — which assembly is a prerequisite for. My data structures professor actually covers an intro to parallel programming if time allows for it. But I’m not sure we will get to it...
I'm organizing my electives for Fall 2019, and I want to take Parallel Programming. I will have finished my math minor this Summer Semester, and will have completed CS Foundations I/II as well as Data Strcutures and Algorithms all taught in C++. I didn't know any programming prior to starting my...
It's referring to C++. My Professor said that they are different function signatures, but reading more about it online the ANSI C++ standard says they are the same -- but GNU treats them as being different.
My compiler (Linux GCC and mingw) treats the first and last as separate signatures. In fact, it doesn't even throw a warning. If I remove the pass-by-reference, however, it will not compile saying that it has already been defined. Which is interesting, because I thought for sure that they would...
Hey all,
I'm reviewing for a data structures exam and covering stuff from the previous course. I am a little confused about something between the book and what my professor says.
If I have the following prototypes:
int sum(int a, int b);
void sum(int a, int b);
int sum(int&a, int&b);
So, I...
I know. It is quadratic if c > 1. However, by definition, and according to my book, since O(n) is no worse than O(nc ) where c > 1, then saying that O(n) is O(n2) for example is correct -- but not best fit. In fact, the author gives multiple examples saying that the only case where it'd be wrong...
I am learning about Big-O notation, and am kind of confused. So, Big-O notation is the upper-bound order that measures the amount of required resources as n approaches a sufficient size. It essentially measures the scalability of an algorithm. My question, however, is with the notation.If an...
I got 38, not 27. The solution was 27. I modified the original post. Hopefully it makes more sense.
Also: I wrote this out by brute force, so I know the answer is indeed 27. But, I'm not sure where I messed up in my work.
Homework Statement
How many nonnegative integer solutions does the following equation has x + y + z = 15 if x ≥ 3, y ≥ 2, and 1 ≤ z ≤ 3?
Homework EquationsThe Attempt at a Solution
Part A:
Since x ≥ 3, y ≥ 2
let a = x - 3 and b = y - 2
a + b + z = 15 - 3 - 2
a + b + z = 10
Therefore,
n = 10...
Homework Statement
I have two homework problems that seem similar, but I'm trying to understand another approach to the problem.
Question 1: One hundred tickets, numbered 1, 2, 3,..., 100, are sold to 100 different people for a drawing. Four different prizes are awarded, including a grand...
Thanks, I see the error in my thinking, now. I think I just spent to much time doing homework and not enough time sleeping last night to think straight. I'm sort of in a mental fog. I appreciate it. Coincidentally, I had no issue with this in Probability and Stats, but its giving me issues in...
Homework Statement
I don't see why this is a combination problem, because to me dealing with bit strings means that order matters.
How many bit strings contain exactly eight 0s and 10 1s if every 0 must be immediately followed by a 1?
Homework EquationsThe Attempt at a Solution
Since every 1...
Hey all,
I have a question regarding C-Strings.
Say I have the following function
#include <iostream>
using namespace std;
int main() {
const int SIZE = 5;
char cstr1[SIZE] = "Hi";
cout << cstr1;
return 0;
}
This will actually print out the string literal.
I'm confused because...
Hey all,
Posting once again. I'm only in my second class on programming ever (with no prior experience to classes). I'm learning about move/copy operations. My textbook says that the move operations is "obviously more efficient than the copy" operation, but it doesn't explain why.
Is it more...
So is this line essentially checking that if aPtr has been defined, then it will have some assigned memory value on the heap? Thus if it has assigned memory value, it wants to delete it since were defining new memory on the heap of an array that may potentially be a different size in line 10...