Just create the object and put it into the array:
adj_list[i] := create {LINKED_LIST[INTEGER]}.make
Phung Dinh Vu wrote:
> I represent an adjacency list of graph G(V,E).
> feature
> adj_list: ARRAY[LINKED_LIST[INTEGER]]
> feature
> make(vertices: INTEGER)
> local
> i: INTEGER
> do
> create adj_list.make(1,vertices)
> from
> i:=1
> until
> i > adj_list.upper
> loop
> create adj_list[i].make
> io.put_string("Enter the vertices match to vertex ")
> io.put_integer(i)
> io.put_string (":%T")
> read_list(adj_list[i])
> i:=i+1
> end
> end
>
> The compile said "expression cannot be used as instruction" at the stage "create adj_list[i].make " Does it make sense? Can anybody help me fix it?
>
>
>
>
> ------------------------------------
>
> Yahoo! Groups Links
>
>
>