Jump to content

Comp sci (java) regarding chains of nodes

Featured Replies

I am currently stuck on this problem

 

Complete the following method that determines if two chains of nodes are equal, that is, they have the same strings in the same order. Note two empty chains are considered equal.

    public static boolean equals(Listnode<String> chain1, Listnode<String> chain2) {

I do not understand how i am supposed to compare the two chians without being able to use an index like you can for arrays.

ANy help would be greatly apprciated

I do not understand how i am supposed to compare the two chians without being able to use an index like you can for arrays.

How do you get access to the nodes in the lists?

Archived

This topic is now archived and is closed to further replies.

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.