Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Java I am trying to implements 2 Arraylist methods as recursive versions of them. private E[] data ; /**** assume eveything else is implemented -----

Java

I am trying to implements 2 Arraylist methods as recursive versions of them.

private E[] data; 

/**** assume eveything else is implemented

----- indexOf -----

@Override public int indexOf(Object target) { return indexOf(data,target); } private int indexOf(E[] data,Object target){ return 0; } 

----- contains-----

@Override public boolean contains(Object target) { boolean found = false;  return contains(data,target); } private boolean contains(E data, Object target){ int tracker = 0; if (target == null){ return false; } else if (!target.equals(data)){ return false; }else   return contains(data,target); } 

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Transactions On Large Scale Data And Knowledge Centered Systems Xxviii Special Issue On Database And Expert Systems Applications Lncs 9940

Authors: Abdelkader Hameurlain ,Josef Kung ,Roland Wagner ,Qimin Chen

1st Edition

3662534541, 978-3662534540

More Books

Students also viewed these Databases questions

Question

Commen Name with scientific name Tiger - Wolf- Lion- Cat- Dog-

Answered: 1 week ago