User Profile

Collapse

Profile Sidebar

Collapse
satan
satan
Last Activity: Dec 11 '06, 06:46 PM
Joined: Oct 10 '06
Location:
  •  
  • Time
  • Show
  • Source
Clear All
new posts

  • satan
    started a topic Need help with BinaryTree
    in Java

    Need help with BinaryTree

    I need to write the definition of the method leavesCount that takes as a parameter a reference of the root node of a binary tree and returns the numbers of leaves in the binary tree. This what i get so far


    Code:
    public class BinaryTree
    {
    
             //Definition of the node
        protected class BinaryTreeNode
        {
            DataElement info;
            BinaryTreeNode llink;
    ...
    See more | Go to post

  • satan
    replied to need help
    in Java
    Here it is

    Code:
    public abstract class ArrayListClass
    {
        protected int length;           //to store the length of the list
        protected int maxSize;          //to store the maximum size of the list
        protected DataElement[] list;   //array to hold the list elements
    
    
            //Default constructor
            //Creates an array of size 100
            //Postcondition: list points
    ...
    See more | Go to post

    Leave a comment:


  • satan
    started a topic need help
    in Java

    need help

    I'm having problem to test a recursive version of a binary search algorithm. These are my codes:

    Code:
    public class OrderedArrayList extends ArrayListClass
    {
            //default constructor
        public OrderedArrayList()
        {
            super();
        }
    
            //constructor with a parameter
        public OrderedArrayList(int size)
        {
            super(size);
        }
    ...
    See more | Go to post

  • satan
    started a topic need assistance
    in Java

    need assistance

    The others classes


    Code:
    public class OrderedArrayList extends ArrayListClass
    {
            //default constructor
        public OrderedArrayList()
        {
            super();
        }
     
            //constructor with a parameter
        public OrderedArrayList(int size)
        {
            super(size);
        }
     
            //copy constructor
        public OrderedArrayList(OrderedArrayList
    ...
    See more | Go to post

  • satan
    started a topic need assistance
    in Java

    need assistance

    I need to call the recursive binarySearch method from my OrderedArrayLis t class into my main program

    Code:
    public abstract class ArrayListClass
    {
        protected int length;           //to store the length of the list
        protected int maxSize;          //to store the maximum size of the list
        protected DataElement[] list;   //array to hold the list elements
     
     
            //Default constructor
    ...
    See more | Go to post

  • satan
    replied to need help
    in Java
    This is the heading for the method copyQueue

    Code:
    /Method to make a copy of otherQueue.
            //Postcondition: A copy of otherQueue is created and
            //               assigned to this queue.
        public void copyQueue(LinkedQueueClass otherQueue)
    ...
    See more | Go to post

    Leave a comment:


  • satan
    replied to need help
    in Java
    Yeah! it's running properly, thanks for your help. But the way you wrote the method copyQueue is not the same thing the problem asks me to do...
    See more | Go to post

    Leave a comment:


  • satan
    replied to need help
    in Java
    It's not working either...
    See more | Go to post

    Leave a comment:


  • satan
    replied to need help
    in Java
    U meant like this! if so i've done like that but it's not working.


    Code:
    //copy constructor
    	public LinkedQueueClass(LinkedQueueClass otherQueue)
    	{
    		queueFront = otherQueue.queueFront;
    		queueRear  = otherQueue.queueRear;
    	}//end copy constructor


    Code:
    Method to make a copy of otherQueue.
            //Postcondition: A copy of otherQueue is created and
    ...
    See more | Go to post

    Leave a comment:


  • satan
    replied to need help
    in Java
    Please, the same what?...
    See more | Go to post

    Leave a comment:


  • satan
    started a topic need help
    in Java

    need help

    I need the definitions of the method copyQueue, the default constructor, and the copy constructor folr the class LinkedQueueClas s.
    This is what i get so far


    Code:
    public abstract class DataElement
    {
        public abstract boolean equals(DataElement otherElement);
          //Method to determine whether two objects contain the
          //same data.
          //Postcondition: Returns true if this object
    ...
    See more | Go to post

  • satan
    replied to need help with Queue program
    in Java
    I'am on it, i will let u know if it's compiling. Thanks...
    See more | Go to post

    Leave a comment:


  • satan
    replied to need help with Queue program
    in Java
    This is the entire class

    Code:
    public class LinkedQueueClass1
    {
              //Definition of the node
        protected class QueueNode
        {
            DataElement info;
            QueueNode link;
        }
    
        private QueueNode queueFront; //reference variable to the
                                      //first element of the queue
        private QueueNode queueRear;  //reference variable
    ...
    See more | Go to post

    Leave a comment:


  • satan
    started a topic need help with Queue program
    in Java

    need help with Queue program

    I need the definitions of the method copyQueue, the default constructor, and the copy constructor folr the class LinkedQueueClas s.


    Code:
    This is my default constructor method
    
    //default constructor
        public LinkedQueueClass()
        {
            queueFront = null;
            queueRear = null;
       }
    See more | Go to post

  • satan
    replied to need help.
    in Java
    [QUOTE=r035198x]
    Yes, it's not compiling. it can not find the symbol getSize in my method StackClass...
    See more | Go to post

    Leave a comment:


  • satan
    replied to need help.
    in Java
    [QUOTE=r035198x]
    Code:
    //How about making use of the size of the stack 
    public boolean equalStack(StackClass otherStack) {
    	if (getSize() != otherStack.getSize()) { //if stack lengths are not equal return false
    		return false;
    	}
    	else {
    		while(!isEmpty()) {
    			if(top().compareTo(otherStack.top()) != 0) {
    				return false;
    			}
    			else {
    				try {
    					pop();
    ...
    See more | Go to post

    Leave a comment:


  • satan
    started a topic need help.
    in Java

    need help.

    I need a help in my method equalStack in my class StackClass.

    Code:
    public class StackClass
    {
        private  int maxStackSize;    //variable to store the maximum
                                      //stack size
        private  int stackTop;        //variable to point to the top
                                      //of the stack
        private  DataElement[] list;  //array of reference variables
    ...
    See more | Go to post

  • satan
    replied to need assistance
    in Java
    Thank you. i appreciate it.
    See more | Go to post

    Leave a comment:


  • satan
    replied to need assistance
    in Java
    Code:
    public abstract class DataElement
    {
        public abstract boolean equals(DataElement otherElement);
          //Method to determine whether two objects contain the 
          //same data.
          //Postcondition: Returns true if this object contains the 
          //               same data as the object otherElement;
          //               otherwise, it returns false.
          
        public abstract int
    ...
    See more | Go to post

    Leave a comment:


  • satan
    replied to need assistance
    in Java
    In the main program...
    See more | Go to post

    Leave a comment:

No activity results to display
Show More
Working...