DFS implementation error?

混江龙づ霸主 提交于 2020-01-24 01:55:06

问题


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>();
}

回答1:


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



来源:https://stackoverflow.com/questions/44242486/dfs-implementation-error

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!