2). What kind of changes have to be done so this code to become executable:
The Code
All of the following is done in python, with the numpy
library, so don't forget to
from numpy import *
Full source code.
First, we need to transform the matrix of outgoing
links into one of incoming links, while preserving the
number of outgoing links per page and identifying leaf
nodes:
def transposeLinkMatrix(
outGoingLinks = [[]]
):
"""
Transpose the link matrix. The link matrix
contains the pages each page points to.
However, what we want is to know which pages
point to a given page. However, we
will still want to know how many links each
page contains (so store that in a separate array),
as well as which pages contain no links at all
(leaf nodes).
@param outGoingLinks outGoingLinks[ii]
contains the indices of pages pointed to by page ii
@return a tuple of (incomingLinks,
numOutGoingLinks, leafNodes)
"""
nPages = len(outGoingLinks)
# incomingLinks[ii]
1). Dev-C++. After Compile %26amp; Run, final result doesn't show up, even with: cin.get();?
Check to see if there is any error or warning which might be causing that.
Reply:Try to run the exe file (of your compiled program) from command prompt .
start -%26gt; run -%26gt; command
or
start -%26gt; run -%26gt; cmd
cd %26lt;path%26gt; //your program folder
ProgramFile (press enter)
see , whether you get output or error
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment