Overview: Suppose the names \"Bob\", \"Dan\", and \"Ben\", are stored as shown b
ID: 3550505 • Letter: O
Question
Overview: Suppose the names "Bob", "Dan", and "Ben", are stored as shown below: ----- ----- head -->| B |---------------->| D | ----- ----- | | | ----- ----- | ----- -->| Ben |-->| Bob | -->| Dan | ----- ----- ----- If the names "Sue" and "Sarah" are added, it looks like this: ----- ----- ----- head -->| B |---------------->| D |-------->| S | ----- ----- ----- | | | | ----- ----- | ----- | ------- ----- -->| Ben |-->| Bob | -->| Dan | -->| Sarah |-->| Sue | ----- ----- ----- ------- -----
Create a class called Index (not generic) that stores strings and implements the structure shown above. The top-level list is kept in sorted order, as is each sublist. You may not use the LinkedList class. You should create your own list nodes and link them together as shown in the illustration. Your class should support these methods: add - adds a new string. remove - removes a string. find - finds a string toString - prints the list like this (using the first list above as input):
B Ben Bob D Dan main - demonstrates the methods of your Index class
Explanation / Answer
Deadline for this?
Related Questions
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.