C++ sorry, I should’ve included that in the OP. I see that assuming root with no children is a leaf, that it can cause issues with various algorithms (IE needing to check when there’s only 1 item in the heap as well as checking whether or not it’s a leaf in pop), so maybe it’s just for reducing...
Hey all,
So, I'm working on heaps, and looking at various implementations of heaps, I find that a lot of people us bool returning function for return (2*i+1 > n), where i is an index of a node stored in an array, and n is the size of the array. (2*i+1 is the formula to get the left child's...
Hey all,
I am narrowing down on my final semesters in college this coming year. I'd like to start making my larger (and better) projects available to potential employers. I was wondering if Github or making a personal website would be better? I'm not going for a front-end development job, so I...
They have Numerical Analysis in our math department. I’m a math minor (completed this part of my degree) and took other courses (mathematical proofs, linear algebra, derministic operations research, and probability). I don’t have enough finances to take more math courses or I would (I’d really...
Hey everyone,
The Short Story:
I need to choose 5 classes from the below list that will make me marketable after graduation aside from an internship.
The Long Story:
I'll be entering my final semesters this coming year. I, mostly, have only electives left. I have to take at least 5 courses...
Thanks. To be sure, I don't need to show an intermittent step on some of the cases? E.G.
Case 2:
x,y < 0
|(-x)(-y)| = |xy| = xy = |x||y|
It's stuff like this where I'm not sure my approach is sufficient in the cases which gives me the feeling of uncertainty.
Homework Statement
This is my second proofs course, but I've always felt uncomfortable with absolute values and inequalities because I feel like my proofs are circular or too simple. In this case, I'm not sure if I'm showing enough in my steps.
I would just like to know if this is a way to...
I am not. Do you have one that you recommend? I use DevC++ and CLion for C++ programming.
Oh. My. God. I think I see what you're saying now. *rolls eyes* smh. Haha.
In code 'b', it added the name to the vector after the for-loop since it didn't trigger a flag. Similarly I could just do a...
The first program doesn't even enter the for-loop once, so nothing is even entering the vector at all. It skips the for-loop entirely. That's why I'm confused. I know the implementation is different. But, I don't see why one should enter the for-loop and the other doesn't when there's no...
I guess I'm confused how these two portions of the code vary. Why does the for loop only get executed in code B, when the code in principle looks the same as code A?
Of course, the method of flagging it with a bool value varies, but nothing differs other than initializing 'valid' before the...
Thanks. I normally don't use input as the conditions of my loops, but it's what Stroustrup was doing, along with the double input.
When I change it to <= the program crashes. I forgot to mention that. :/
Homework Statement
First of all, this ISN'T homework. This is independent study. I am in a CS program, but I am going through PPP by Bjarne Stroustrup to keep the language fresh. I'm working on one of the last assignment in chapter 4 which is this:
Write a program where you first enter a set...
Homework Statement
Suppose that X ~ N(μ,σ). Find a in terms of μ and σ if P(X>a) = 1/3 * P(X ≤a)
Homework EquationsThe Attempt at a Solution
1 - P(X ≤a) = 1/3 * P(X ≤a)
3 = 4P(X ≤a)
P(X ≤a) = 3/4
Since x0 = μ + σz0 where x0 and z0 are the same percentile for N(μ,σ) and N(0,1)...
Hey all,
I'm currently working on my CS degree with a mathematics minor. After this Fall, I will only have one more course to take to finish my minor.
I'm debating between Linear Algebra and Deterministic Operations Research. I do have other options, but these seem to be most applicable to CS...