/**
 * This exercise focuses on implementing a while loop to calculate the complex conjugate and absolute value
 * of a given set of complex numbers. The real part of the complex number is stored in the 'realNums' list
 * and the imaginary part is stored in the 'imagNums' list. The function returns a list containing the complex
 * conjugate and absolute value of each complex number.
 */
fun complexConjugateAbsWhileLoop(realNums: List<Double>, imagNums: List<Double>): List<Triple<Double, Double, Double>> {

    val result = mutableListOf<Triple<Double, Double, Double>>()
    var i = 0

    while (i < realNums.size) {
        val realPart = realNums[i]
        val imagPart = imagNums[i]

        // Complex conjugate calculation
        val conjReal = realPart
        val conjImag = -imagPart

        // Absolute value calculation
        val absoluteValue = Math.sqrt(realPart * realPart + imagPart * imagPart)

        result.add(Triple(conjReal, conjImag, absoluteValue))
        i++
    }

    return result
}
/**
 * This exercise focuses on implementing a while loop to calculate the complex conjugate and absolute value
 * of a given set of complex numbers. The real part of the complex number is stored in the 'realNums' list
 * and the imaginary part is stored in the 'imagNums' list. The function returns a list containing the complex
 * conjugate and absolute value of each complex number.
 */
fun complexConjugateAbsWhileLoop(realNums: List<Double>, imagNums: List<Double>): List<Triple<Double, Double, Double>> {
/**
 * This exercise focuses on implementing a while loop to calculate the complex conjugate and absolute value
 * of a given set of complex numbers. The real part of the complex number is stored in the 'realNums' list
 * and the imaginary part is stored in the 'imagNums' list. The function returns a list containing the complex
 * conjugate and absolute value of each complex number.
 */
fun complexConjugateAbsWhileLoop(realNums: List<Double>, imagNums: List<Double>): List<Triple<Double, Double, Double>> {

    val result = mutableListOf<Triple<Double, Double, Double>>()
    var i = 0

    while (i < realNums.size) {
        val realPart = realNums[i]
        val imagPart = imagNums[i]

        // Complex conjugate calculation
        val conjReal = realPart
        val conjImag = -imagPart

        // Absolute value calculation
        val absoluteValue = Math.sqrt(realPart * realPart + imagPart * imagPart)

        result.add(Triple(conjReal, conjImag, absoluteValue))
        i++
    }

    return result
}