Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

The three attached files contain similar data. Test is the small file that can be used to check your results. Your code should only access

The three attached files contain similar data. Test is the small file that can be used to check your results. Your code should only access one file at a time.
We want to find the unique "links" to the first element in the file. You can think of the first 3 numbers as the web page and the next 3 numbers as a link to it. We want to write code that provides the number of unique links. You should not use contains or any other method to determine if a link has been added. We would like to know how many lines are in the selected file when we run the program. You should use an Iterator to print the results.
Sample output for Test.txt:
Number unique elements 3
Total number of lines 7
Unique links
0002
0011
0022
I encourage you to get the Test.txt file working before moving to Test2.txt or testFile.txt.
test.txt
000001
002001
000001
001002
000002
002000
001002

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_2

Step: 3

blur-text-image_3

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

Making Databases Work The Pragmatic Wisdom Of Michael Stonebraker

Authors: Michael L. Brodie

1st Edition

1947487167, 978-1947487161

More Books

Students also viewed these Databases questions

Question

7. It is advisable to do favors for people whenever possible.

Answered: 1 week ago

Question

9. Power and politics can be destructive forces in organizations.

Answered: 1 week ago