algoritm

DOCX 5 pages 678.5 KB Free download

Page preview (5 pages)

Scroll down 👇
1 / 5
o’zbekiston respublikasi raqamli texnologiyalar vazirligi muhammad al-xorazmiy nomidagi toshkent axborot texnologiyalar universiteti ma’lumotlar tuzilmasi va algoritmlar fanidan 3-amaliy topshiriq toshkent – 2024 18-variant #include using namespace std; void swapfmlx(int arr[], int n, int index, int minindex, int maxindex, bool firstminfound, bool lastmaxfound) { if (index >= n) { if (firstminfound && lastmaxfound) { // birinchi minimum va oxirgi maksimumni almashtirish swap(arr[minindex], arr[maxindex]); } return; } // birinchi minimumni topish if (!firstminfound && arr[index] = arr[maxindex]) { maxindex = index; lastmaxfound = true; } // rekursiv chaqiruv swapfmlx(arr, n, index + 1, minindex, maxindex, firstminfound, lastmaxfound); } int main() { int n; cout > n; if (n > arr[i]; } int minindex = 0, maxindex = 0; swapfmlx(arr, n, 0, minindex, maxindex, false, false); cout << "massivni almashtirilgan ko'rinishi: \n"; for (int i = 0; i < n; ++i) { cout << arr[i] << " "; } cout << endl; return …
2 / 5
algoritm - Page 2
3 / 5
algoritm - Page 3
4 / 5
algoritm - Page 4
5 / 5
algoritm - Page 5

Want to read more?

Download all 5 pages for free via Telegram.

Download full file

About "algoritm"

o’zbekiston respublikasi raqamli texnologiyalar vazirligi muhammad al-xorazmiy nomidagi toshkent axborot texnologiyalar universiteti ma’lumotlar tuzilmasi va algoritmlar fanidan 3-amaliy topshiriq toshkent – 2024 18-variant #include using namespace std; void swapfmlx(int arr[], int n, int index, int minindex, int maxindex, bool firstminfound, bool lastmaxfound) { if (index >= n) { if (firstminfound && lastmaxfound) { // birinchi minimum va oxirgi maksimumni almashtirish swap(arr[minindex], arr[maxindex]); } return; } // birinchi minimumni topish if (!firstminfound && arr[index] = arr[maxindex]) { maxindex = index; lastmaxfound = true; } // rekursiv chaqiruv swapfmlx(arr, n, index + 1, minindex, maxindex, firstminfound, lastmaxfound); } int main() { int n; cout > n; if (n > arr[i]; } int mi...

This file contains 5 pages in DOCX format (678.5 KB). To download "algoritm", click the Telegram button on the left.

Tags: algoritm DOCX 5 pages Free download Telegram