New user? Sign up

Existing user? Sign in

Please help me with a code to sort the principal diagonal of square matrix.

Note by Space Sizzlers 2 years, 9 months ago

Easy Math Editor

*italics*

_italics_

**bold**

__bold__

- bulleted- list

1. numbered2. list

paragraph 1paragraph 2

paragraph 1

paragraph 2

[example link](https://brilliant.org)

> This is a quote

This is a quote

# I indented these lines # 4 spaces, and now they show # up as a code block. print "hello world"

2 \times 3

2^{34}

a_{i-1}

\frac{2}{3}

\sqrt{2}

\sum_{i=1}^3

\sin \theta

\boxed{123}

Sort by:

What language? Would it be ok to copy the elements of the diagonal into a separate vector?

More details needed.

Log in to reply

In java or C++ and yes copying the elements, is not a problem .

Please be aware that my C++ skills are weak.

Problem Loading...

Note Loading...

Set Loading...

Easy Math Editor

`*italics*`

or`_italics_`

italics`**bold**`

or`__bold__`

boldNote: you must add a full line of space before and after lists for them to show up correctlyparagraph 1

paragraph 2

`[example link](https://brilliant.org)`

`> This is a quote`

Remember to wrap math in \( ... \) or \[ ... \] to ensure proper formatting.`2 \times 3`

`2^{34}`

`a_{i-1}`

`\frac{2}{3}`

`\sqrt{2}`

`\sum_{i=1}^3`

`\sin \theta`

`\boxed{123}`

## Comments

Sort by:

TopNewestWhat language? Would it be ok to copy the elements of the diagonal into a separate vector?

More details needed.

Log in to reply

In java or C++ and yes copying the elements, is not a problem .

Log in to reply

Please be aware that my C++ skills are weak.

Log in to reply