مورد · دليل أو مقال
Euclidean algorithm
يعرّف بطريقة إقليدس لإيجاد القاسم المشترك الأكبر (GCD) عبر الطرح المتكرر، مع رسوم توضيحية هندسية.
تمت المراجعة
افتح المصدر الأصلي: Euclidean algorithm (يفتح الموقع الأصلي في علامة تبويب جديدة)أضِف إلى خريطة طريق
احتفظ بهذا المورد مع خريطة طريق تتبعها. يظهر موردًا إضافيًا خاصًا بك، فلا تتغير خطوات الخريطة ولا يُحتسب ضمن خطواتك المتتبَّعة.
لغة المحتوى الأصلي: الإنجليزية
In mathematics, the Euclidean algorithm, or Euclid's algorithm, is an efficient method for computing the greatest common divisor (GCD) of two numbers, the largest number that divides both of them without leaving a remainder. The Euclidean algorithm is based on the principle that the greatest common divisor of two numbers does not change if the larger number is replaced by its difference with the smaller number. For example, 21 is the GCD of 252 and 105 (as 252 = 21 × 12 and 105 = 21 × 5), and the same number 21 is also the GCD of 105 and 252 − 105 = 147. Since this replacement reduces the larger of the two numbers, repeating this process gives successively smaller pairs of numbers until the two numbers become equal. When that occurs, they are the GCD of the original two numbers. By reversing the steps, the GCD can be expressed as a sum of the two original numbers each multiplied by a positive or negative integer, e.g., 21 = 5 × 105 + (−2) × 252. The fact that the GCD can always be expressed in this way is known as Bézout's identity.
نظرة عامة من PrepKit
كتب محررو PrepKit هذه النظرة العامة وراجعوها اعتمادًا على المستودع المصدر. وهي ليست نصًا من المورد نفسه.
- مناسب لـ
- لا يحدد المصدر مستوى
- الشكل
- مرجع
ما الذي يغطيه
- استبدال العدد الأكبر بالفرق يحافظ على GCD، مع مثال على 252 و105
- متطابقة بيزو: 21 = 5 مضروبًا في 105 زائد -2 مضروبًا في 252
- رسوم تبليط لمستطيل 24 في 60 ورسم متحرك يختزل 1071 و462 إلى 21
كيف تستخدمه
نصيحة دراسية من PrepKit، وليست ادعاءً من المصدر.
اكتب نسختي الطرح وباقي القسمة وقارن عدد الخطوات لـ 1071 و462، ثم أضف الخوارزمية الموسّعة وأعد استخراج معاملات بيزو.
النطاق والقيود
صيغة الطرح وحدها: لا صيغة باقي القسمة ولا الخوارزمية الموسّعة ولا زمن التنفيذ.
الوصول والشكل
ملف README مجاني بالإنجليزية على GitHub في المستودع trekhleb/javascript-algorithms المرخّص بترخيص MIT.
راجعه PrepKit في 02/10/2026. إيداع مصدر المورد: 85293e3e2b88
أدلة هذه النظرة العامة
- src/algorithms/math/euclidean-algorithm/README.md
صفحات تتضمن هذا العنصر
اشترك في النشرة البريدية من PrepKit
اختيارية. لا تحتاج إليها لاستخدام PrepKit.