Method AdjMatrixDiGraph.removeVertex() tests to see if an entry represents an edge (is equal to 1) and if so, clears it (sets it to 0). Would the method be more efficient if it just walked through and cleared the appropriate row and column of the adjacency matrix? Would this work?

What will be an ideal response?


Avoiding the test to see if the entry is 1 would make the loop more efficient. The problem is that to decrement numberOfEdges correctly, you need the check to see if the entry is 1 or not.

Computer Science & Information Technology

You might also like to view...

A key security issue in the design of any _________ is to prevent, or at least detect, attempts by a user or a piece of malicious software from gaining unauthorized privileges on the system.

Fill in the blank(s) with the appropriate word(s).

Computer Science & Information Technology

________ involve using a physical attribute such as a fingerprint for authentication

a. Backdoors b. Rootkits c. Biometrics d. Trojan horses

Computer Science & Information Technology

Case-Based Critical Thinking Question ? Patrice hosts a radio show on his college station. He wants to post clips from some of his shows on his website for review by potential employers. Patrice specifies a MIME type ofaudio/mpegfor each of his clips. This is because the clips are encoded in which audio format?

A. AAC B. mp3 C. Opus D. Vorbis

Computer Science & Information Technology

The branch of computer graphics that studies methods for creating images at a rate matching that of the real world is called ____.

A. just-in-time graphics B. real-time graphics C. new world graphics D. real-world graphics

Computer Science & Information Technology