DFS implementation error?
Asked Answered
P

1

-1

I am using dfs algorithm to implement from geeksforgeeks.org link here

but when ever i have tried to run on compiler it is giving this error

Note: p1_dfs.java uses unchecked or unsafe operations.

Note: Recompile with -Xlint:unchecked for details.

YES I HAVE SEARCHED FOR IT ! AND GET SOLUTION HERE link here

BUT its not working I have changed generic type of list but not getting correct.

// Constructor
Graph(int v)
{
    V = v;
    adj = new LinkedList<Integer>[v];
    for (int i=0; i<v; ++i)
        adj[i] = new LinkedList<Integer>();
}
Purpura answered 29/5, 2017 at 12:26 Comment(6)
What you have changed shouldn't matter, although preferred way, but that is not what is causing the error. Anyway, I managed to run the same code using java 1.8, and it executed in first go.Savanna
@coolgirl you have mistaken something code may be run but will show this compilation error in extraPurpura
@coolgirl u can checkk out her ide.geeksforgeeks.org/iM0r5lPurpura
My IDE isn't complaining of any compilation errors TBH.Savanna
okk @coolgirl check out above linkPurpura
Yea, it shows up there. Check this https://mcmap.net/q/555721/-quot-uses-unchecked-or-unsafe-operations-quot-duplicateSavanna
P
0

Its an error(not actually) generate by compier. So. Leave it and Run Program. :)

Purpura answered 29/5, 2017 at 13:27 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.