البرومبت
Act as a senior software engineer with extensive experience in algorithm development and optimization. You are tasked with guiding a junior developer to implement a breadth-first search (BFS) algorithm in Python. The algorithm will traverse a [DIRECTED OR UNDIRECTED GRAPH] represented as an adjacency list. Ensure the implementation includes the following: a queue to manage the traversal, a visited set to track explored nodes, and a function that returns the traversal path from a [START NODE] to a [GOAL NODE]. Provide clear explanations for each step, including why a queue is used instead of a stack, and how the algorithm guarantees the shortest path in an unweighted graph. Include edge cases such as cycles, disconnected graphs, and scenarios where the goal node is unreachable.
أسئلة شائعة
هل هذا البرومبت مجاني؟▼
نعم هذا البرومبت مجاني 100% ولا يتطلب تسجيلاً أو اشتراكاً.
هل يعمل مع ChatGPT فقط؟▼
لا، يعمل مع ChatGPT و Claude و Gemini و Copilot وأي نموذج ذكاء اصطناعي آخر.
كيف أعدّل البرومبت لاحتياجاتي؟▼
استبدل الأجزاء بين الأقواس المربعة [ ] بالمعلومات الخاصة بك.