Sắp xếp theo thứ tự tăng dần 5/4;8/7;11/10;-13/15;22/-77
Hãy nhập câu hỏi của bạn vào đây, nếu là tài khoản VIP, bạn sẽ được ưu tiên trả lời.
a,sắp xếp theo thứ tự tăng dần
5/8 , 9/16 , 2/3 và 7/12
b,sắp xếp theo thứ tự giảm dần
10/329 , 3/94 ,5/163 , 6/187
c sắp xếp theo thứ tự tăng dần
78/35 , 102/47 .88/29 ,61 / 52

Vì √24 < √29 < √32 < √45
Nên ta sắp xếp được: 2√6 < √29 < 4√2 < 3√5
1: \(23=\sqrt{23^2}=\sqrt{569};2\sqrt7=\sqrt{2^2\cdot7}=\sqrt{28}\)
\(5\sqrt6=\sqrt{5^2\cdot6}=\sqrt{150};-8\sqrt2=-\sqrt{8^2\cdot2}=-\sqrt{128}\) ; \(-\sqrt{127}=-\sqrt{127}\)
mà \(-\sqrt{128}<-\sqrt{127}<0<\sqrt{28}<\sqrt{150}<\sqrt{569}\)
nên \(-8\sqrt2<-\sqrt{127}<2\sqrt7<5\sqrt6<\sqrt{569}\)
2: \(6\sqrt{\frac14}=\sqrt{6^2\cdot\frac14}=\sqrt9;4\cdot\sqrt{\frac12}=\sqrt{4^2\cdot\frac12}=\sqrt8\) ;
\(-\sqrt{132}=-\sqrt{132};2\sqrt3=\sqrt{2^2\cdot3}=\sqrt{12};\sqrt{\frac{15}{5}}=\sqrt3\)
mà \(\sqrt{12}>\sqrt9>\sqrt8>\sqrt3>-\sqrt{132}\)
nên \(2\sqrt3>6\sqrt{\frac14}>4\sqrt{\frac12}>\sqrt{\frac{15}{5}}>-\sqrt{132}\)
\(\dfrac{3}{4}=\dfrac{3\times5}{4\times5}=\dfrac{15}{20}\)
\(\dfrac{2}{4}=\dfrac{2\times5}{4\times5}=\dfrac{10}{20}\)
\(1=\dfrac{20}{20}\)
\(\dfrac{6}{5}=\dfrac{6\times4}{5\times4}=\dfrac{24}{20}\)
Vì \(\dfrac{10}{20}< \dfrac{15}{20}< \dfrac{20}{20}< \dfrac{24}{20}\) nên \(\dfrac{2}{4}< \dfrac{3}{4}< 1< \dfrac{6}{5}\)
THAM KHẢO!
1.Thuật toán sắp xếp chèn (Insertion Sort):
def insertion_sort(arr):
for i in range(1, len(arr)):
key = arr[i]
j = i - 1
while j >= 0 and arr[j] > key:
arr[j + 1] = arr[j]
j -= 1
arr[j + 1] = key
return arr
A = [5, 8, 1, 0, 10, 4, 3]
sorted_A = insertion_sort(A)
print("Dãy A sau khi sắp xếp chèn:", sorted_A)
2. Thuật toán sắp xếp chọn (Selection Sort):
def selection_sort(arr):
for i in range(len(arr)):
min_idx = i
for j in range(i + 1, len(arr)):
if arr[j] < arr[min_idx]:
min_idx = j
arr[i], arr[min_idx] = arr[min_idx], arr[i]
return arr
A = [5, 8, 1, 0, 10, 4, 3]
sorted_A = selection_sort(A)
print("Dãy A sau khi sắp xếp chọn:", sorted_A)
3.Thuật toán sắp xếp nổi bọt (Bubble Sort):
def bubble_sort(arr):
n = len(arr)
for i in range(n - 1):
for j in range(n - 1 - i):
if arr[j] > arr[j + 1]:
arr[j], arr[j + 1] = arr[j + 1], arr[j]
return arr
A = [5, 8, 1, 0, 10, 4, 3]
sorted_A = bubble_sort(A)
print("Dãy A sau khi sắp xếp nổi bọt:", sorted_A)