هياكل البيانات والخوارزميات (DSA27) · الأسبوع 1

Why this course · Python basics (Lecture 01, Lab 01)

هذه اختبارات للتدريب الذاتي، تُحفظ إجاباتك على هذا الجهاز فقط ولا تُرسل إلى أحد. الأسئلة والشرح بالإنجليزية لغة المقرر.

النتيجة: 0 / 42 · أُجيب: 0

  1. W1-M01 تذكّر

    "Every general-purpose programming language is Turing-complete." What does that tell you?

  2. W1-M02 تذكّر

    Python's type system is best described as:

  3. W1-M03 تطبيق

    What does "3" + 5 do in Python?

  4. W1-M04 تذكّر

    How does Rust manage memory?

  5. W1-M05 تذكّر

    Where and why was C created?

  6. W1-M06 تذكّر

    An Abstract Data Type specifies:

  7. W1-M07 تطبيق

    Which of these is the declarative (comprehension) style from Lecture 01?

  8. W1-M08 تذكّر

    What does the TIOBE index actually count?

  9. W1-M09 تعليل

    In the course's three levels of knowledge, which is know-why?

  10. W1-M10 تذكّر

    To pass this course, a student needs:

  11. W1-M11 تطبيق

    What is -7 // 2?

  12. W1-M12 تطبيق

    What is -7 % 3?

  13. W1-M13 تطبيق

    What is 2 ** 3 ** 2?

  14. W1-M14 تطبيق

    What is type(8 / 4)?

  15. W1-M15 تطبيق

    With word = "Python", what is word[1:4]?

  16. W1-M16 تطبيق

    What is "Mansoura"[::-2]?

  17. W1-M17 تطبيق

    After a = [1, 2, 3], b = a, b.append(4), what is a?

  18. W1-M18 تطبيق

    After a = [1, 2] and c = a[:], what are c is a and c == a?

  19. W1-M19 تطبيق

    grid = [[0] * 2] * 2, then grid[0][0] = 1. What is grid?

  20. W1-M20 تذكّر

    What is round(2.5) + round(3.5)?

  21. W1-M21 تعليل

    Why is 0.1 + 0.2 == 0.3 False in Python?

  22. W1-M22 تطبيق

    What happens when you run s = "abc" then s[0] = "z"?

  23. W1-M23 تطبيق

    A function's body is print(width * height) and nothing else. What does x = area(3, 4) store in x?

  24. W1-M24 تطبيق

    What does int("4.5") do?

  25. W1-M25 تعليل

    In C, reading a[10] from a 5-element array returns whatever happens to be in memory; in Python, a[10] on a 5-element list raises IndexError. Which explanation matches Lecture 01?

  26. W1-M26 تطبيق

    What does Python print for 2 ** 64 + 1?

  27. W1-M27 تعليل

    Why do the course's exercises never call input()?

  28. W1-M28 تطبيق

    What is f'{7:03d}|{3.14159:.2f}'?

  29. W1-M29 تطبيق

    What does this print?

    a = [1, 2, 3]
    b = a
    a = a + [4]
    b.append(5)
    print(a, b)
  30. W1-M30 تعليل

    xs = [42, "hello", 3.14] holds an int, a str and a float in one list. Why is that possible?

  31. W1-M31 تذكّر

    Lecture 01 lists three properties we care about in an algorithm. In the lecture's order, they are:

  32. W1-M32 تعليل

    You time linear and binary search on a sorted list of 20 items, and linear search is faster. Does this contradict "binary search is O(log n), linear search is O(n)"?

  33. W1-M33 تطبيق

    An O(n2) program takes 2 seconds on today's data. The data grows ten times larger. About how long will it take now?

  34. W1-M34 تعليل

    TIOBE ranked Visual Basic above Rust in September 2026. What does Lecture 01 conclude from rankings like this?

  35. W1-M35 تذكّر

    What is 'a,b,,c'.split(',')?

  36. W1-M36 تعليل

    A shop stores prices in pounds as float values and adds them up. Why does Lab 01 say not to, and what should it do instead?

  37. W1-M37 تذكّر

    What do 'banana'.find('z') and 'banana'.index('z') do?

  38. W1-M38 تعليل

    Lecture 01 calls Python's built-in list, dict, sorted and heapq "the honest case against Python — for us". Why are they a problem in this course?

  39. W1-M39 تذكّر

    Which pairing of designer, language and decision is correct?

  40. W1-M40 تعليل

    Lecture 01 says you cannot write badly-indented Python. Why?

  41. W1-M41 تطبيق

    What does this print?

    def min_max(a, b):
        if a < b:
            return a, b
        return b, a
    
    result = min_max(9, 2)
    print(type(result).__name__, result[0])
  42. W1-M42 تطبيق

    What does this print?

    grid = [[0, 0], [0, 0]]
    copy = grid[:]
    copy[0][0] = 9
    copy[1] = [7, 7]
    print(grid)

36 درجات

أسئلة المقال

10 أسئلة مقالية (36 درجة). اكتب إجابتك أولًا، ثم اعرض الإجابة النموذجية ونقاط التصحيح، وقدّر درجتك بأمانة: كل نقطة تساوي درجة تقريبًا.

مجموع درجات المقال: 0 / 36

  1. W1-E1 تعليل 4 درجات

    "All programming languages are the same; only the syntax differs." Explain what is true in this statement and what is wrong with it. Give one concrete example of a design decision that makes two languages genuinely different.

  2. W1-E2 تعليل 4 درجات

    Explain the two independent axes of type systems. Place Python and JavaScript on both axes, and show with one expression how their behaviour differs.

  3. W1-E3 تذكّر 3 درجات

    Describe the three approaches to memory management from Lecture 01, naming one language that uses each. Which one does Python use, and why does that make data structures harder to see in Python?

  4. W1-E4 تعليل 4 درجات

    Distinguish an Abstract Data Type from a data structure. Illustrate with the Stack ADT and two different structures that implement it.

  5. W1-E5 تعليل 3 درجات

    Give two reasons the course uses Python, and the honest drawback of Python for this course. How does the course deal with that drawback?

  6. W1-E6 تعليل 3 درجات

    "In Python a variable is not a box holding a value; it is a name bound to an object." Explain this with a short code example and a diagram, and state one consequence for lists.

  7. W1-E7 تعليل 4 درجات

    "Measure, do not assert." Explain why the course asks you to measure an algorithm's cost, what a measurement shows that a Big-O table does not, and one way a measurement can mislead you, with how to avoid it.

  8. W1-E8 تعليل 3 درجات

    "print is not return." Explain the difference with a two-line function, say what a test sees in each case, and explain why the exercises use parameters and return rather than input() and print().

  9. W1-E9 تعليل 4 درجات

    "Which language is best?" is not a question. Rewrite it as the real questions it hides, and explain why the ecosystem of a language matters more than its syntax, naming at least three parts of an ecosystem.

  10. W1-E10 تطبيق 4 درجات

    Compare Python's int and float with C's int: what happens when a value gets very large, what that costs, and why 0.1 + 0.2 == 0.3 is False. State the two rules Lab 01 gives for working with floats.