Rikka's Profile User Rating: -----

Reputation: 0 Apprentice
Group:
Members
Active Posts:
31 (0.04 per day)
Joined:
21-June 11
Profile Views:
1,105
Last Active:
User is offline Mar 09 2012 11:43 PM
Currently:
Offline

Previous Fields

Country:
Who Cares
OS Preference:
Windows
Favorite Browser:
Chrome
Favorite Processor:
AMD
Favorite Gaming Platform:
PC
Your Car:
Who Cares
Dream Kudos:
0
Icon   Rikka Master all the Sorting Algorithms! :)

Posts I've Made

  1. In Topic: Problem on Implementing Heap Tree only not the Sort itself

    Posted 8 Mar 2012

    This is my new code:

    public static void heapTree(int array[], int len){
        boolean heap;
        
        for (int i =((len-1)/2); i>0; i--){
                int k=i;
                int v= array[k];
                heap = false;
                
            while ((!heap)&&(2*k)<len-1){
               int j=2*k;
                   if(j<len-1){
                        if(array[j]<array[j+1])
                             j=j+1;
                            if(v>=array[j])
                                heap=true;    
                            else{
                                array[k] = array[j];
                                k=j;
                        }
                    
                    } array[k] = v;
           
            }     
             System.out.print(" || ");
            for(int x = 0; x < array.length; x++) {
                    System.out.print(" || " + array[x] + " ");
                }
                System.out.println();
            }
        } 
    


    the output is only up to the third pass :(
  2. In Topic: Problem on Implementing Heap Tree only not the Sort itself

    Posted 8 Mar 2012

    The example output is what it should be..

    public static void heapTree(int array[], int len){
        int i, o;
       int lChild, rChild, mChild, root, temp;
       root = (len-1)/2;
     
      for(o = root; o >= 0; o--){
       for(i=root;i>=0;i--){
       lChild = (2*i)+1;
       rChild = (2*i)+2;
       if((lChild <= len) && (rChild <= len)){
       if(array[rChild] >= array[lChild])
       mChild = rChild;
       else
       mChild = lChild;
       }
       else{
       if(rChild > len)
       mChild = lChild;
       else
       mChild = rChild;
       }
       
       System.out.print(" || Pass " + o + "-->  ");
                for(int x = 0; x < array.length; x++) {
                    System.out.print(array[x] + " ");
                }
                System.out.println();
       }
      }
    }
    


    I just want to view the tree itself and not the sorted one..
  3. In Topic: problem with constructors and methods

    Posted 28 Jul 2011

    Thanks to all who answered. :D I'm done with this already.
    Lots of Love :rockon:
  4. In Topic: problem with constructors and methods

    Posted 26 Jul 2011

    View Postmacosxnerd101, on 26 July 2011 - 12:02 PM, said:

    You should be using instance fields, not local variables. Instance fields are declared in the class, but not within any methods. These fields do not have the static modifier, and they are used to represent attributes about the object.

    class Person{
        private String name; //<-- name is an instance field
    }
    
    


    Also, make sure you read my tutorial as well. It covers this in greater detail, and I think it will help clear up a lot of concepts regarding OOP.


    so how will "Ann" in main be passed in setName and in s.Name? :(
  5. In Topic: problem with constructors and methods

    Posted 26 Jul 2011

    Oh sorry for that. It actually has "}" but since I edited the code, it was accidentally removed. Sorry sir. :)

    I'm having troubles in these:

    public Student(String nm, int t1, int t2, int t3) {
        String Name = nm ;
        int Test1 = s.Test1() ;
        int Test2 = s.Test2() ;
        int Test3 = s.Test3();
    
    


    I dunno how will I use this "s" in each line :(
    and how to manipulate the setName and setScores so that the values will be passed to the ones above. :(

My Information

Member Title:
New D.I.C Head
Age:
Age Unknown
Birthday:
Birthday Unknown
Gender:
Years Programming:
3
Programming Languages:
c++, java, visual basic, cobol

Contact Information

E-mail:
Private
Twitter:
innocentchill

Friends

Comments

Page 1 of 1
  1. Photo

    jeremejazz Icon

    12 Apr 2012 - 18:53
    hi how r u? :)
  2. Photo

    jeremejazz Icon

    11 Sep 2011 - 22:25
    hello :) are you from the Phils? :D
  3. Photo

    fromTheSprawl Icon

    17 Jul 2011 - 18:05
    Hey my classmate asks what is your section, :)
  4. Photo

    fromTheSprawl Icon

    17 Jul 2011 - 17:06
    My workmate is a cum laude from FEU. I did not study there though
  5. Photo

    fromTheSprawl Icon

    15 Jul 2011 - 02:46
    FEU?
  6. Photo

    bevz Icon

    13 Jul 2011 - 08:05
    .....?where kna
  7. Photo

    LieannM Icon

    13 Jul 2011 - 00:58
    haaard :(
  8. Photo

    LieannM Icon

    13 Jul 2011 - 00:58
    haaard :(
  9. Photo

    pau:) Icon

    13 Jul 2011 - 00:49
    0.0?? hahah
  10. Photo

    pau:) Icon

    13 Jul 2011 - 00:49
    0.0?? hahah
  11. Photo

    bevz Icon

    13 Jul 2011 - 00:43
    hi...
Page 1 of 1