Recent content by Of Mike and Men

  1. O

    When a heap only has 1 node, is that node a leaf?

    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...
  2. O

    When a heap only has 1 node, is that node a leaf?

    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...
  3. O

    Other Computer Science: Github vs. Personal Website?

    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...
  4. O

    Courses What upper division undergrad courses for CS?

    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...
  5. O

    Courses What upper division undergrad courses for CS?

    Thanks, I appreciate it. Also, I modified the post. Operating systems was already a required course -- not an elective. My bad. :)
  6. O

    Courses What upper division undergrad courses for CS?

    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...
  7. O

    Prove if x,y are reals that |xy| = |x||y|

    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.
  8. O

    Prove if x,y are reals that |xy| = |x||y|

    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...
  9. O

    Why isn't my for loop triggering?

    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...
  10. O

    Why isn't my for loop triggering?

    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...
  11. O

    Why isn't my for loop triggering?

    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...
  12. O

    Why isn't my for loop triggering?

    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. :/
  13. O

    Why isn't my for loop triggering?

    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...
  14. O

    Normal Distribution Question

    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)...
  15. O

    Courses Linear Algebra vs Deterministic Operations Research for CS

    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...
Back
Top