Search:

Type: Posts; User: IAmHere

Search: Search took 0.74 seconds.

  1. Replies
    10
    Views
    1,044

    Re: A 2d array problem

    I meant
    4 is at location image1[0][1]
    4 is the value.


    so,

    top = 1;
    bottom = 2;
    left = 1;
  2. Replies
    10
    Views
    1,044

    Re: A 2d array problem

    {1, 2, 3},
    {4, 5, 6},
    {7, 8, 9}

    1 is (0,0)
    2 is (1,0)
    3 is (2, 0)
    4 is (0, 1)
    .
    .
  3. Replies
    10
    Views
    1,044

    Re: A 2d array problem

    Sorry for the confusion.

    The first 2d array is:
    int[][] image1 = { {1, 2, 3},
    {4, 5, 6},
    {7, 8, 9}, };
    The second 2d array is:
    top = 1;
    bottom = 2;
    left = 1;
  4. Replies
    10
    Views
    1,044

    Re: A 2d array problem

    (top, left) is the coordinates for the top left corner of the 2d array.
    (bottom,right) is the coordinates for the bottom right corner of the 2d array.

    So, we have 4 variables.
    ...
  5. Replies
    10
    Views
    1,044

    A 2d array problem

    Given a 2d array
    and

    4 variables that creates another 2d array.
    (top, left) and (bottom,right)

    (Those are the coordinates to form another 2d array.)
    These variables can partially cover the...
  6. Replies
    1
    Views
    437

    How come the mean is 7?

    How do I calculate the mean?
    The answer for this case is 7.
    Why?

    My assignment is here(if you want to know the question but I don't think you need it to answer "my" question):...
  7. Replies
    3
    Views
    762

    Re: Compute the average image value

    So, a "sub-region of the image" is a rectangle. So, how do I compute the average of a rectangle?
  8. Replies
    3
    Views
    762

    Compute the average image value

    This is my assignment:
    http://www.cse.yorku.ca/course/2011/assignments/assignment%201/Q2/Q2.html

    I have no idea what is an image value. I tired looking it up but there's no help.

    All the codes...
  9. Replies
    6
    Views
    550

    Re: My Idea about this forum...

    Sorry, I just posted a question under a section and I notice there is a better section for my type of question.
    So, I posted a question twice...
    eek...
  10. Replies
    0
    Views
    454

    A Simple Pumping Lemma Question.

    I don't understand the palindrome word a(b^n)a.

    Based on the pumping lemma definition:
    The pumping states that: |word| >=n
    and
    The length of this word is (1 + n + 1) which is...
  11. Re: plz help me with this program.....i would be highly...obliged if i'm helped

    I think he is asking us to find a relation with those numbers and to print those numbers using a nested for loop.

    =)
  12. Replies
    6
    Views
    2,127

    Re: Java Binary Tree (Beginners)?

    if t.hasALeft(v) then
    {
    left = t.left(v)
    }

    return weight(t, left) + weight(t, right)

    if t.hasARight(v) then
    {
    right = t.Right(v)
  13. Replies
    3
    Views
    1,086

    [SOLVED] Re: Traversing a tree

    I figured it out.


    static boolean method (BinaryTree t)
    {
    ...
    return method2(t, t.root());
    }
  14. Replies
    3
    Views
    1,086

    [SOLVED] Re: Traversing a tree

    I'm not sure how to write a recursive method with a tree as a parameter.
    I'm guessing you have to call its subtree every time.
  15. Replies
    3
    Views
    1,086

    [SOLVED] Traversing a Tree (Beginners)

    In my book, I'm given BinaryTree t and Node v as my parameter. So, I can traverse the tree by doing like:



    static boolean add(BinaryTree t, Node v )
    return add(t, t.left(v)) + add(t,...
  16. Replies
    6
    Views
    550

    Re: My Idea about this forum...

    Ok. =)
    I usually ask people if I'm on the right track. So, I guess it's ok to ask them to have a quick check on my work.
    I'll try to post more detailed questions and posts.
    Thanks for your tips.
  17. Replies
    6
    Views
    2,127

    Re: Java Binary Tree (Beginners)?

    I think you're right.

    So, I changed my code so that the base case meets your requirement.
    So my code right???



    // returns the weight of node v
    static int weight(BinaryTree t, Node v)
    if...
  18. Replies
    6
    Views
    2,127

    Re: Java Binary Tree (Beginners)?

    I was about to do it your way, but I notice that in my book, there's no method t.hasRight(v) and t.right(v) . It only checks for the left children.
    So, I guess I have to stick to my original code.
    ...
  19. Replies
    6
    Views
    550

    My Idea about this forum...

    Hi, I'm new here.

    I found the reply for my posted question to be slow. If I'm stuck on something, I have to wait a day until I get a reply.

    My suggestion is to make a chatbox on this forum, so...
  20. Replies
    6
    Views
    2,127

    Java Binary Tree (Beginners)?

    I'm suppose to add up all the number that are in a node of a binary tree.

    Is this correct???

    This is just the algorithm:::


    static int weight(BinaryTree t, Node v)
    if t.size == 0 then //if...
  21. Replies
    1
    Views
    1,123

    Convert this to non-recursive

    public static int f(int a, int b)
    {
    Z.h1(a, b); //// arbitrary code

    if (Z.h2(a, b))
    return Z.h3(a, b);

    else
    {
    ...
Results 1 to 21 of 22