خوارزميات Myers Diff و LCS7 دقائق للقراءةآخر تحديث في
خوارزميات مقارنة النصوص والأكواد: دليل Myers Diff و LCS
استكشف رياضيات مقارنة النصوص، وقارن بين العرض المنقسم والموحد، وراجع التعديلات محليًا بأمان.
W
فريق هندسة WEBioDD•معالجة محلية 100% بدون خوادم
النقاط الرئيسية
- تحسب خوارزمية Myers أقصر مسار تحويل باستخدام البحث البياني بتعقيد زمني O(ND).
- المقارنة على مستوى المحارف تبرز التعديلات الدقيقة داخل الأسطر المتغيرة بوضوح.
- العرض المنقسم جنبًا إلى جنب مثالي للمقارنات الهيكلية الكبيرة بينما الموحد مخصص لملفات Git Patch.
- المقارنة المحلية تمنع تخزين الشيفرات المصدرية الحساسة في سجلات مواقع الفحص الخارجية.
100% In-Browser & Local Execution
مقارنة فروقات الأكواد والنصوص
افحص الفروقات سطرًا بسطر ومحرفًا بمحرف جنبًا إلى جنب أو في عرض موحد مع تلوين الصياغة.
- Myers Diff algorithm
- Split & unified views
- Character-level highlighting
- Whitespace toggle
01.The Myers Diff Algorithm & Shortest Edit Script
Published by Eugene W. Myers in 1986, the Myers Diff algorithm finds the minimum number of insertions and deletions (the Shortest Edit Script) required to transform string A into string B. By modeling text comparison as a directed acyclic graph (edit graph) on a 2D grid, the algorithm executes an O(ND) search where N is the total length and D is the edit distance.
02.Split Side-by-Side vs. Unified Diff Visualization
Split view places original and modified files in parallel columns, synchronizing scroll positions for structural comparisons. Unified view interleaves additions (+) and deletions (-) in a single column, which is the standard format used by Git patches (git diff).
How to Compare Code and Text Revisions
Step-by-step instructions to inspect code diffs.
1
Paste Original Text
Paste the original source code or text into the left editor pane.
2
Paste Modified Text
Paste the updated revision into the right editor pane.
3
Toggle Diff View
Switch between Split (side-by-side) and Unified view modes depending on your preference.
4
Review Character Highlights
Inspect colored red (deleted) and green (added) inline highlights.
Frequently Asked Questions
No. The Myers diff algorithm executes 100% locally in your browser memory.