Docsity
Docsity

Prepare for your exams
Prepare for your exams

Study with the several resources on Docsity


Earn points to download
Earn points to download

Earn points by helping other students or get them with a premium plan


Guidelines and tips
Guidelines and tips

CS6515 Exam 2: Trees, Flow Graphs, and Modular Arithmetic, Exams of Nursing

A comprehensive overview of key concepts in computer science, particularly focusing on data structures, algorithms, and cryptography. It covers topics like trees, flow graphs, modular arithmetic, and rsa protocol. Exercises and explanations, making it a valuable resource for students studying computer science.

Typology: Exams

2024/2025

Available from 02/11/2025

smart-scores
smart-scores 🇺🇸

5

(2)

6.8K documents

1 / 13

Toggle sidebar

This page cannot be seen from the preview

Don't miss anything!

bg1
CS6515 Exam 2 with verified solutions
Basic |!|Properties |!|of |!|Trees |!|- |!|correct |!|answer |!|Tree's |!|are |!|undirected, |!|connected |!|and |!|acyclic |!|
that |!|connect |!|all |!|nodes.
1. |!|Tree |!|on |!|n |!|vertices |!|has |!|(n-1) |!|edges |!|-> |!|would |!|have |!|a |!|cycle |!|otherwise |!|(more |!|than |!|n-1 |!|
edges |!|means |!|cycle)
2. |!|In |!|tree |!|exactly |!|one |!|path |!|between |!|every |!|pair |!|of |!|vertices |!|(otherwise |!|it's |!|not |!|connected)
- |!|More |!|than |!|1 |!|path |!|implies |!|cycle
- |!|less |!|than |!|1 |!|path |!|implies |!|not |!|connected
3. |!|Any |!|connected |!|G(V, |!|E) |!|with |!||E| |!|= |!||V| |!|- |!|1 |!|is |!|a |!|tree
Kruskal's |!|Algorithm |!|- |!|correct |!|answer |!|1. |!|Sort |!|E |!|by |!|increasing |!|weigt
2. |!|Go |!|through |!|edges |!|in |!|order |!|and |!|add |!|an |!|edge |!|to |!|our |!|current |!|tree |!|if |!|it |!|doesn't |!|create |!|a |!|
cycle
Running |!|Time: |!|O(m |!|log |!|n), |!|m |!|= |!||E|, |!|n |!|= |!||V|
Is |!|there |!|ever |!|a |!|reason |!|to |!|use |!|cycles |!|in |!|a |!|flow |!|graph? |!|- |!|correct |!|answer |!|No
Flow |!|Network |!|Constraints: |!|Capacity |!|Constraint |!|- |!|correct |!|answer |!|For |!|all |!|edges, |!|the |!|flow |!|
must |!|be |!|larger |!|than |!|zero, |!|but |!|less |!|than |!|the |!|capacity |!|of |!|that |!|edge
Goal |!|of |!|Flow |!|Problem |!|- |!|correct |!|answer |!|Maximize |!|the |!|flow |!|out |!|of |!|the |!|source |!|(or |!|into |!|the
|!|sink) |!|of |!|maximum |!|size |!|while |!|satisfying |!|the |!|capacity |!|and |!|conservation |!|of |!|flow |!|constraints.
Flow |!|Network |!|Constraints: |!|Conservation |!|of |!|Flow |!|- |!|correct |!|answer |!|For |!|all |!|vertices |!|(other |!|
than |!|the |!|starting |!|(source) |!|and |!|ending |!|(sink) |!|vertices), |!|the |!|flow |!|into |!|v |!|must |!|equal |!|the |!|flow |!|
out |!|of |!|v.
pf3
pf4
pf5
pf8
pf9
pfa
pfd

Partial preview of the text

Download CS6515 Exam 2: Trees, Flow Graphs, and Modular Arithmetic and more Exams Nursing in PDF only on Docsity!

CS6515 Exam 2 with verified solutions

Basic |!|Properties |!|of |!|Trees |!|- |!|correct |!|answer |!| Tree's |!|are |!|undirected, |!|connected |!|and |!|acyclic |!| that |!|connect |!|all |!|nodes.

  1. |!|Tree |!|on |!|n |!|vertices |!|has |!|(n-1) |!|edges |!|-> |!|would |!|have |!|a |!|cycle |!|otherwise |!|(more |!|than |!|n-1 |!| edges |!|means |!|cycle)
  2. |!|In |!|tree |!|exactly |!|one |!|path |!|between |!|every |!|pair |!|of |!|vertices |!|(otherwise |!|it's |!|not |!|connected)
  • |!|More |!|than |!| 1 |!|path |!|implies |!|cycle
  • |!|less |!|than |!| 1 |!|path |!|implies |!|not |!|connected
  1. |!|Any |!|connected |!|G(V, |!|E) |!|with |!||E| |!|= |!||V| |!|- |!| 1 |!|is |!|a |!|tree Kruskal's |!|Algorithm |!|- |!|correct |!|answer |!| 1. |!|Sort |!|E |!|by |!|increasing |!|weigt
  2. |!|Go |!|through |!|edges |!|in |!|order |!|and |!|add |!|an |!|edge |!|to |!|our |!|current |!|tree |!|if |!|it |!|doesn't |!|create |!|a |!| cycle Running |!|Time: |!|O(m |!|log |!|n), |!|m |!|= |!||E|, |!|n |!|= |!||V| Is |!|there |!|ever |!|a |!|reason |!|to |!|use |!|cycles |!|in |!|a |!|flow |!|graph? |!|- |!|correct |!|answer |!| No Flow |!|Network |!|Constraints: |!|Capacity |!|Constraint |!|- |!|correct |!|answer |!| For |!|all |!|edges, |!|the |!|flow |!| must |!|be |!|larger |!|than |!|zero, |!|but |!|less |!|than |!|the |!|capacity |!|of |!|that |!|edge Goal |!|of |!|Flow |!|Problem |!|- |!|correct |!|answer |!| Maximize |!|the |!|flow |!|out |!|of |!|the |!|source |!|(or |!|into |!|the |!|sink) |!|of |!|maximum |!|size |!|while |!|satisfying |!|the |!|capacity |!|and |!|conservation |!|of |!|flow |!|constraints. Flow |!|Network |!|Constraints: |!|Conservation |!|of |!|Flow |!|- |!|correct |!|answer |!| For |!|all |!|vertices |!|(other |!| than |!|the |!|starting |!|(source) |!|and |!|ending |!|(sink) |!|vertices), |!|the |!|flow |!|into |!|v |!|must |!|equal |!|the |!|flow |!| out |!|of |!|v.

Ford-Fulkerson |!|Algo |!|- |!|correct |!|answer |!| 1. |!|Start |!|with |!|f_e |!|= |!| 0 |!|for |!|all |!|edges

  1. |!|Build |!|the |!|residual |!|network |!|for |!|current |!|flow
  2. |!|Find |!|st-path |!|in |!|residual |!|network
  • |!|if |!|no |!|such |!|path |!|then |!|output |!|f
  1. |!|Let |!|c(p) |!|= |!|min(c_e |!|- |!|f_e); |!|this |!|is |!|available |!|capacity |!|along |!|some |!|path
  2. |!|Augment |!|f |!|by |!|c(p) |!|along |!|p
  • |!|for |!|forward |!|edges |!|increase |!|flow |!|by |!|c(p)
  • |!|for |!|backward |!|edge, |!|decrease |!|flow |!|by |!|c(p)
  1. |!|Repeat Residual |!|Network |!|- |!|correct |!|answer |!| For |!|flow |!|network |!|G |!|= |!|(V, |!|E) |!|with |!|c_e |!|for |!|edges |!|and |!| f_e |!|for |!|flows:
  2. |!|If |!|there |!|exists |!|an |!|edge |!|vw |!|where |!|f_vw |!|< |!|c_vw, |!|add |!|vw |!|to |!|residual |!|network |!|with |!| capacity |!|c_vw |!|- |!|f_aw
  3. |!|If |!|there |!|exists |!|an |!|edge |!|vw |!|where |!|f_vw |!|> |!|0, |!|then |!|add |!|wv |!|to |!|residual |!|network |!|with |!| capacity |!|f_vw Note: |!| 1 |!|shows |!|available |!|forwards |!|capacities |!|and |!| 2 |!|shows |!|residual |!|backward |!|capacities. Ford-Fulkerson |!|Runtime |!|- |!|correct |!|answer |!| Need |!|to |!|assume |!|all |!|capacities |!|are |!|integers. |!|This |!| will |!|allow |!|flow |!|to |!|always |!|increase |!|by |!|at |!|least |!| 1 |!|unit |!|per |!|round. |!|If |!|C |!|is |!|the |!|maxflow, |!|then |!| there |!|are |!|at |!|most |!|C |!|rounds. |!|Each |!|round |!|of |!|FF |!|takes |!|O(m), |!|so |!|the |!|total |!|time |!|is |!|O(mC), |!| which |!|is |!|pseudo-polynomial What |!|is |!|the |!|time |!|to |!|check |!|whether |!|or |!|not |!|a |!|flow |!|is |!|a |!|max |!|flow |!|- |!|correct |!|answer |!| - |!|O(n |!|
  • |!|m)
  1. |!|Build |!|the |!|residual |!|graph |!|takes |!|O(n |!|+ |!|m) |!|time
  2. |!|Checking |!|if |!|there's |!|a |!|path |!|from |!|s |!|to |!|t |!|using |!|DFS, |!|which |!|takes |!|linear |!|time. Capacity |!|of |!|a |!|Cut |!|- |!|correct |!|answer |!| Sum |!|of |!|capacities |!|(edges) |!|going |!|from |!|cut |!|L |!|to |!|cut |!|R

When |!|does |!|the |!|inverse |!|of |!|x |!|MOD |!|N |!|exist |!|- |!|correct |!|answer |!| When |!|GCD(x, |!|N) |!|= |!|1. |!|That |!|is |!| x |!|and |!|N |!|don't |!|share |!|a |!|common |!|divisor |!|and |!|are |!|thus |!|"relatively |!|prime" Properties |!|of |!|Modular |!|Inverses |!|- |!|correct |!|answer |!| - |!|if |!|x^-1 |!|MOD |!|N |!|exists, |!|then |!|it's |!|unique

  • |!|x^-1 |!|MOD |!|N |!|doesn't |!|exist |!|when |!|gcd(x, |!|N) |!|> |!| 1 Euclid's |!|Rule |!|- |!|correct |!|answer |!| - |!|If |!|x |!|>= |!|y |!|> |!|0:
  • |!|gcd(x, |!|y) |!|= |!|gcd(x |!|MOD |!|y, |!|y) Note: |!|For |!|Euclid's |!|also |!|that |!|gcd(x, |!|0) |!|= |!|x Extended-Euclid's |!|algorithm |!|alpha |!|and |!|beta |!|output |!|params |!|- |!|correct |!|answer |!| - |!|Alpha |!|is |!|the |!|inverse |!|of |!|x |!|MOD |!|y
  • |!|Beta |!|is |!|the |!|inverse |!|of |!|y |!|MOD |!|x Fermat's |!|Little |!|Theorem |!|- |!|correct |!|answer |!| - |!|If |!|p |!|is |!|prime |!|then |!|for |!|every |!| 1 |!|<= |!|z |!|<= |!|p |!|- |!|1:
  • |!|z |!|^ |!|(p-1) |!|::: |!| 1 |!|MOD |!|P Note: |!|since |!| 1 |!|<= |!|z |!|<= |!|p |!|- |!| 1 |!|that |!|the |!|gcd(z, |!|p) |!|= |!|1; |!|they |!|are |!|relatively |!|prime Euler's |!|Theorem |!|- |!|correct |!|answer |!| - |!|for |!|any |!|N,z |!|where |!|gcd(z, |!|N) |!|= |!|1; |!|that |!|is |!|they |!|are |!| relatively |!|prime:
  • |!|then |!|z^(phi(n)) |!|= |!| 1 |!|mod |!|N phi(N) |!|= |!|# |!|of |!|integers |!|between |!| 1 |!|& |!|N |!|which |!|are |!|relatively |!|prime |!|to |!|N phi(N) |!|- |!|is |!|called |!|Euler's |!|totient |!|function Note: |!|Euler's |!|Theorem |!|is |!|a |!|generalization |!|of |!|Fermat's |!|little |!|theorem |!|for |!|arbitrary |!|N RSA |!|Protocol |!|- |!|correct |!|answer |!| 1. |!|Bob |!|picks |!| 2 |!|n-bit |!|random |!|primes |!|p |!|& |!|q
  1. |!|Bob |!|chooses |!|e |!|relatively |!|prime |!|to |!|(p-1)(q-1)
  2. |!|Bob |!|publishes |!|his |!|public |!|key |!|(p*q, |!|e)
  3. |!|Bob |!|computes |!|his |!|private |!|key: |!|d |!|::: |!|e^-1 |!|mod |!|(p-1)(q-1)
  4. |!|Alice |!|looks |!|up |!|Bob's |!|public |!|key |!|(pq, |!|e)
  5. |!|Alice |!|computes |!|y:::m^e |!|MOD |!|N
  6. |!|Bob |!|receives |!|y
  7. |!|Bob |!|decrypted: |!|computes |!|y^d |!|MOD |!|N |!|::: |!|m RSA |!|Pitfalls |!|- |!|correct |!|answer |!| 1. |!|If |!|gcd(m, |!|N) |!|> |!|1, |!|crypto |!|system |!|is |!|broken
  8. |!|m |!|is |!|not |!|too |!|large |!|(m |!|< |!|N)
  9. |!|m |!|is |!|not |!|too |!|small, |!|MOD |!|N |!|doesn't |!|do |!|anything
  • |!|send |!|m |!|and |!|r, |!|padding |!|message |!|by |!|m |!|+ |!|r
  1. |!|send |!|same |!|m, |!|e |!|times
  • |!|can |!|decrypt |!|message |!|using |!|Chinese |!|remainder |!|theorem Fermat's |!|Test |!|- |!|correct |!|answer |!| - |!|Find |!|z |!|where |!|z |!|^(r-1) |!|!= |!| 1 |!|mod |!|r --> |!|r |!|is |!|composite
  • |!|This |!|is |!|called |!|a |!|Fermat |!|Witness --> |!|every |!|composite |!|has |!|a |!|Fermat |!|Witness Trivial |!|Fermat |!|Witness |!|- |!|correct |!|answer |!| Passes |!|Fermat's |!|test |!|and |!|z |!|where |!|gcd |!|(z, |!|r) |!|> |!|1. |!| Trivial |!|since |!|don't |!|really |!|need |!|to |!|run |!|Fermat's |!|Test. Non-trivial |!|Fermat |!|Witness |!|- |!|correct |!|answer |!| - |!|z |!|where |!|gcd(z, |!|r) |!|= |!| 1 |!|that |!|also |!|passes |!| Fermat's |!|Test |!|(z^(r-1) |!|::: |!| 1 |!|mod |!|r)
  • |!|if |!|this |!|is |!|the |!|case, |!|then |!|a |!|composite |!|number |!|has |!|many |!|Fermat |!|Witnesses; |!|thus |!|they |!|are |!| easy |!|to |!|find

Fast |!|Modular |!|Exponentiation |!|Algorithm |!|- |!|correct |!|answer |!| Inputs: |!|x, |!|y |!|>= |!|0, |!|N |!|>= |!| 1 Outputs: |!|x^y |!|MOD |!|N Runtime: |!|O(N^3)* Description: |!|recursively |!|squaring |!|modulus Euclid's |!|GCD |!|Algorithm |!|- |!|correct |!|answer |!| Inputs: |!|x>= |!|y |!|>= |!| 0 Outputs: |!|GCD |!|of |!|x |!|and |!|y Runtime: |!|O(n^3) Description: |!|Recursively |!|computes |!|gcd(x, |!|y) |!|as |!|gcd(x |!|mod |!|y, |!|y). |!|Can |!|be |!|used |!|to |!|check |!|if |!| two |!|numbers |!|are |!|relatively |!|prime |!|to |!|each |!|other. Extended |!|Euclid's |!|Algorithm |!|- |!|correct |!|answer |!| Inputs: |!|x>= |!|y |!|>= |!| 0 Outputs: |!|

  1. |!|d: |!|gcd |!|of |!|x |!|and |!|y
  2. |!|a, |!|b: |!|coefficients |!|s.t. |!|ax |!|+ |!|by |!|= |!|d Runtime: |!|O(N^3) Description: |!|Will |!|output |!|GCD |!|of |!|x |!|and |!|y, |!|and |!|if |!|this |!|GCD |!|is |!|1, |!|it |!|will |!|also |!|output |!|the |!| respective |!|inverses |!|of |!|x |!|and |!|y. Explore |!|Algorithm |!|- |!|correct |!|answer |!| Input: |!|Graph |!|G, |!|and |!|vertex |!|v Output: |!|
  3. |!|visited[u] |!|is |!|set |!|to |!|true |!|for |!|all |!|nodes |!|u |!|reachable |!|from |!|v Runtime: |!|O(m)

Post |!|Order |!|Properties: |!|Tree |!|Edges |!|- |!|correct |!|answer |!| For |!|edge |!|z |!|-> |!|w, |!|post(z) |!|> |!|post(w) Post |!|Order |!|Properties: |!|Back |!|Edge |!|- |!|correct |!|answer |!| For |!|edge |!|z |!|-> |!|w, |!|post(z) |!|< |!|post(w) Post |!|Order |!|Properties: |!|Forward |!|Edge |!|- |!|correct |!|answer |!| For |!|edge |!|z |!|-> |!|w, |!|post(z) |!|> |!|post(w) Post |!|Order |!|Properties: |!|Cross |!|Edge |!|- |!|correct |!|answer |!| - |!|For |!|edge |!|z |!|-> |!|w, |!|post(z) |!|> |!|post(w)

  • |!|Note |!|cross |!|edges |!|have |!|no |!|ancestor-descendent |!|relationship Properties |!|of |!|a |!|Graph: |!|Cycles |!|- |!|correct |!|answer |!| A |!|graph |!|G |!|has |!|a |!|cycle |!|iff |!|its |!|DFS |!|tree |!| (starting |!|from |!|any |!|vertex) |!|has |!|a |!|back |!|edge Topological |!|Sorting |!|a |!|DAG |!|- |!|correct |!|answer |!| - |!|Order |!|vertices |!|so |!|that |!|all |!|edges |!|go |!|lower |!|to |!|higher
  • |!|Order |!|vertices |!|by |!|decreasing |!|post |!|order |!|#
  • |!|Ordering |!|only |!|takes |!|O(n |!|+ |!|m) |!|time |!|(make |!|an |!|array |!|in |!|advance |!|and |!|put |!|in |!|corresponding |!| position |!|when |!|post |!|order |!|for |!|vertex |!|is |!|found) Source |!|Vertex |!|- |!|correct |!|answer |!| - |!|No |!|incoming |!|edges |!|= |!|highest |!|post |!|order |!|# |!|in |!|DAG Sink |!|Vertex |!|- |!|correct |!|answer |!| - |!|No |!|outgoing |!|edges |!|= |!|lowest |!|post |!|order |!|# |!|in |!|DAG Finding |!|Connected |!|Components |!|and |!|Topologically |!|Sorting |!|- |!|correct |!|answer |!| Undirected |!|Graph |!|- |!| 1 |!|run |!|DFS DAG |!|- |!| 1 |!|run |!|DFS General |!|Directed |!|Graph |!|- |!| 2 |!|runs |!|DFS Can |!|Metagraphs |!|of |!|SCC |!|contain |!|cycles? |!|- |!|correct |!|answer |!| - |!|No, |!|must |!|be |!|a |!|DAG SCC |!|Algorithm |!|Idea |!|- |!|correct |!|answer |!| - |!|Find |!|sink |!|SCC, |!|output |!|it, |!|remove |!|it, |!|and |!|repeat

Dijkstra's |!|Algorithm |!|- |!|correct |!|answer |!| Input: |!|Graph |!|(directed/un-directed), |!|Start |!|vertex. Output: |!|

  1. |!|dist[u] |!|- |!|distance |!|from |!|s |!|to |!|u |!|if |!|s |!|can |!|reach |!|u
  2. |!|prev[z] |!|- |!|parent |!|index |!|of |!|vertex |!|z Runtime: |!|O( |!|(n |!|+ |!|m) |!|* |!|log(n) |!|) More |!|sophisticated |!|BFS |!|that |!|utilizes |!|miniheap |!|data |!|structure. |!|Such |!|requires |!|an |!|additional |!| log(n) |!|time |!|over |!|BFS |!|because |!|of |!|this SCC |!|Algorithm |!|- |!|correct |!|answer |!| Input: |!|Directed |!|Graph Output: |!|
  3. |!|Metagraph |!|of |!|G. |!|
  4. |!|Connected |!|Component |!|Numbers |!|for |!|each |!|vertex |!|(this |!|comes |!|from |!|DFS, |!|explained |!|above) Runtime: |!|O(n |!|+ |!|m) Kruskal |!|Algorithm |!|- |!|correct |!|answer |!| Input: |!|connected |!|undirected |!|graph |!|G, |!|edge |!|weights |!|w Output: |!|minimum |!|spanning |!|tree |!|defined |!|by |!|the |!|edges Runtime: |!|O(m |!|log(m)) |!|or |!|O(m |!|log(n)) Input: |!|Connected, |!|undirected |!|graph. |!|(Must |!|have |!|edge |!|weights... |!|basis |!|of |!|algo) How |!|it |!|works: |!|Basically |!|Sorts |!|edges |!|from |!|least |!|to |!|greatest |!|and |!|starts |!|building |!|the |!|tree.

Prim's |!|Algorithm |!|- |!|correct |!|answer |!| Runtime: |!|O(m |!|log(m)) |!|or |!|O(m |!|log(n)) Input: |!|Connected, |!|undirected |!|graph. |!|(Must |!|have |!|edge |!|weights... |!|basis |!|of |!|algo) Output: |!|The |!|Minimum |!|Spanning |!|Tree |!|of |!|the |!|graph. How |!|it |!|works: |!|Starts |!|at |!|a |!|vertex |!|and |!|adds |!|the |!|smallest |!|connecting |!|edge |!|to |!|unvisited |!|node. Ford |!|Fulkerson |!|Algorithm |!|- |!|correct |!|answer |!| Runtime: |!|O(mC) Input: |!|Graph |!|with |!|integer |!|edge |!|weights. |!|(Note: |!|Does |!|not |!|work |!|with |!|Infinity) Output: |!|max |!|flow |!|f* Edmonds-Karp |!|Algorithm |!|- |!|correct |!|answer |!| Runtime: |!|O(nm^2) Input: |!|Graph |!|with |!|integer |!|edge |!|weights. |!|(Note: |!|Works |!|with |!|Infinity!) Output: |!|max |!|flow |!|f* Orlin |!|Max |!|Flow |!|Algorithm |!|- |!|correct |!|answer |!| - |!|Current |!|best |!|solution |!|to |!|max |!|flow |!|problem

  • |!|Run |!|Time: |!|O(mn) Augmenting |!|Path |!|- |!|correct |!|answer |!| A |!|path |!|that |!|exists |!|on |!|the |!|residual |!|graph |!|from |!|s |!|-> |!|t. This |!|type |!|of |!|path |!|implies |!|there |!|exists |!|more |!|flow |!|that |!|can |!|be |!|pushed |!|through |!|the |!|graph. This |!|occurs |!|when |!|there |!|exists |!|a |!|path |!|through |!|which |!|the |!|minimum |!|residual |!|capacity |!|F |!| among |!|all |!|edges |!|in |!|the |!|path |!|is |!|greater |!|than |!|0. When |!|is |!|a |!|flow |!|a |!|max |!|flow |!|- |!|correct |!|answer |!| When |!|there |!|is |!|no |!|augmenting |!|path |!|in |!|the |!| residual |!|graph Size(flow) |!|= |!|- |!|correct |!|answer |!| F_out(L) |!|- |!|f_in(L)

Adding/Removing |!|an |!|Edge |!|to |!|G^f |!|implies |!|- |!|correct |!|answer |!| - |!|Add: |!|if |!|add |!|y->z, |!|then |!|edge |!| z->y |!|must |!|be |!|on |!|augmenting |!|path

  • |!|Remove |!|y |!|->z, |!|then |!|edge |!|y |!|->z |!|must |!|be |!|on |!|augmenting |!|path How |!|to |!|topologically |!|sort |!|a |!|DAG |!|- |!|correct |!|answer |!| Sort |!|vertices |!|by |!|decreasing |!|post-order |!|# Post-order |!|# |!|Properties |!|for |!|DAG |!|- |!|correct |!|answer |!| - |!|highest |!|post |!|order |!|# |!|is |!|source
  • |!|lowest |!|post |!|order |!|# |!|is |!|sink |!|(this |!|is |!|not |!|always |!|true |!|for |!|general |!|directed |!|graphs |!|but |!|is |!| always |!|true |!|for |!|DAGs) Number |!|of |!|Edges |!|in |!|dense |!|graph |!|- |!|correct |!|answer |!| n(n-1)/