answer string | choices dict | id string | kind string | lang string | question string | steps list | subject string | text string | topic string |
|---|---|---|---|---|---|---|---|---|---|
Selection sort repeatedly picks the minimum and swaps it forward. | null | cs_0151 | concept | en | How does selection sort work? | [
"Find minimum unsorted.",
"Swap to front.",
"Repeat for rest."
] | computer_science | Answer: Pick min, swap forward.
Steps:
1. Find minimum unsorted.
2. Swap to front.
3. Repeat for rest. | algorithms |
Selection sort always scans quadratically: O(n^2). | {
"A": "O(n^2)",
"B": "O(n log n)",
"C": "O(n)",
"D": "O(log n)"
} | cs_0152 | multiple_choice | en | What is selection sort's complexity? | [
"n passes over n.",
"Quadratic total.",
"Select option A."
] | computer_science | Answer: O(n^2).
Steps:
1. n passes over n.
2. Quadratic total.
3. Select option A.
Answer: (A) | algorithms |
Selection sort gives [10,14,29] after two swaps. | null | cs_0153 | worked_example | en | Selection-sort [29,10,14]. What are the steps? | [
"Min is 10: swap to [10,29,14].",
"Min of rest is 14: swap to [10,14,29].",
"Sorted in 2 swaps."
] | computer_science | Answer: [10,14,29].
Steps:
1. Min is 10: swap to [10,29,14].
2. Min of rest is 14: swap to [10,14,29].
3. Sorted in 2 swaps. | algorithms |
Třídění výběrem hledá minimum a přesouvá ho dopředu. | null | cs_0154 | concept | cs | Co je třídění výběrem? | [
"Najdi minimum.",
"Prohoď dopředu.",
"Opakuj pro zbytek."
] | computer_science | Answer: Výběr minima dopředu.
Steps:
1. Najdi minimum.
2. Prohoď dopředu.
3. Opakuj pro zbytek. | algorithms |
Linear search worst case scans everything: O(n). | {
"A": "O(1)",
"B": "O(n)",
"C": "O(log n)",
"D": "O(n^2)"
} | cs_0155 | multiple_choice | en | What is linear search's worst case? | [
"Target last or absent.",
"Scan all n.",
"Select option B."
] | computer_science | Answer: O(n).
Steps:
1. Target last or absent.
2. Scan all n.
3. Select option B.
Answer: (B) | algorithms |
Searching 9 in [1..8] takes 8 comparisons and fails. | null | cs_0156 | worked_example | en | Linear search for 9 in [1,2,3,4,5,6,7,8]. How many comparisons? | [
"Check each of 8.",
"None matches.",
"8 comparisons, not found."
] | computer_science | Answer: 8, not found.
Steps:
1. Check each of 8.
2. None matches.
3. 8 comparisons, not found. | algorithms |
Greedy algorithms take the locally best step hoping for global optimum. | null | cs_0157 | concept | en | What is a greedy algorithm? | [
"Choose best now.",
"Never backtrack.",
"Example: coin change."
] | computer_science | Answer: Locally best steps.
Steps:
1. Choose best now.
2. Never backtrack.
3. Example: coin change. | algorithms |
Faktoriál 4 je 24, tedy 4 x 3 x 2 x 1. | null | cs_0158 | worked_example | cs | Vypočítej faktoriál(4). | [
"4 x faktoriál(3).",
"Rozviň: 4x3x2x1.",
"Výsledek = 24."
] | computer_science | Answer: 24.
Steps:
1. 4 x faktoriál(3).
2. Rozviň: 4x3x2x1.
3. Výsledek = 24. | algorithms |
BFS uses a queue to expand level by level. | {
"A": "Stack",
"B": "Heap",
"C": "Queue",
"D": "Tree"
} | cs_0159 | multiple_choice | en | Which structure does BFS use? | [
"Level order needed.",
"Queue gives FIFO.",
"Select option C."
] | computer_science | Answer: Queue.
Steps:
1. Level order needed.
2. Queue gives FIFO.
3. Select option C.
Answer: (C) | algorithms |
Divide and conquer splits problems, solves parts, and combines answers. | null | cs_0160 | concept | en | What is divide and conquer? | [
"Divide input.",
"Conquer parts.",
"Combine results."
] | computer_science | Answer: Split, solve, combine.
Steps:
1. Divide input.
2. Conquer parts.
3. Combine results. | algorithms |
Merging [1,4] and [2,3] gives [1,2,3,4] in 3 comparisons. | null | cs_0161 | worked_example | en | Merge [1,4] and [2,3]. What are the steps? | [
"1 vs 2: take 1.",
"4 vs 2: take 2; 4 vs 3: take 3.",
"Take 4: [1,2,3,4]."
] | computer_science | Answer: [1,2,3,4].
Steps:
1. 1 vs 2: take 1.
2. 4 vs 2: take 2; 4 vs 3: take 3.
3. Take 4: [1,2,3,4]. | algorithms |
Dijkstra computes shortest paths in weighted graphs. | {
"A": "MST",
"B": "Max flow",
"C": "Sorting",
"D": "Shortest path"
} | cs_0162 | multiple_choice | en | What does Dijkstra's algorithm find? | [
"Weighted edges.",
"Shortest distances.",
"Select option D."
] | computer_science | Answer: Shortest path.
Steps:
1. Weighted edges.
2. Shortest distances.
3. Select option D.
Answer: (D) | algorithms |
Hladový algoritmus volí lokálně nejlepší krok. | null | cs_0163 | concept | cs | Co je hladový algoritmus? | [
"Nejlepší krok teď.",
"Bez návratu.",
"Příklad: mince."
] | computer_science | Answer: Lokálně nejlepší kroky.
Steps:
1. Nejlepší krok teď.
2. Bez návratu.
3. Příklad: mince. | algorithms |
Merge sort averages O(n log n). | {
"A": "Bubble sort",
"B": "Merge sort",
"C": "Selection sort",
"D": "Insertion sort"
} | cs_0164 | multiple_choice | en | Which averages O(n log n)? | [
"Others are quadratic.",
"Merge divides evenly.",
"Select option B."
] | computer_science | Answer: Merge sort.
Steps:
1. Others are quadratic.
2. Merge divides evenly.
3. Select option B.
Answer: (B) | algorithms |
3-disk Hanoi needs 7 moves (2^3 - 1). | null | cs_0165 | worked_example | en | How many moves for 3-disk Tower of Hanoi? | [
"Formula: 2^n - 1.",
"Substitute: 8 - 1.",
"Moves = 7."
] | computer_science | Answer: 7.
Steps:
1. Formula: 2^n - 1.
2. Substitute: 8 - 1.
3. Moves = 7. | algorithms |
Big-Omega gives a lower growth bound. | null | cs_0166 | concept | en | What is Big-Omega notation? | [
"At least this fast.",
"Lower bound.",
"Example: Omega(n)."
] | computer_science | Answer: Lower bound.
Steps:
1. At least this fast.
2. Lower bound.
3. Example: Omega(n). | complexity |
Omega bounds growth from below. | {
"A": "Lower bound",
"B": "Upper bound",
"C": "Exact bound",
"D": "No bound"
} | cs_0167 | multiple_choice | en | What does Omega describe? | [
"Minimum growth.",
"Lower bound.",
"Select option A."
] | computer_science | Answer: Lower bound.
Steps:
1. Minimum growth.
2. Lower bound.
3. Select option A.
Answer: (A) | complexity |
A triple loop with n = 10 runs 1,000 iterations. | null | cs_0168 | worked_example | en | How many iterations for triple nested loops with n = 10? | [
"Each level runs 10.",
"Total = 10^3.",
"Iterations = 1,000."
] | computer_science | Answer: 1,000.
Steps:
1. Each level runs 10.
2. Total = 10^3.
3. Iterations = 1,000. | complexity |
Nejlepší případ je nejrychlejší možný vstup. | null | cs_0169 | concept | cs | Co je nejlepší případ? | [
"Nejrychlejší vstup.",
"Dolní odhad.",
"Příklad: prvek první."
] | computer_science | Answer: Nejrychlejší vstup.
Steps:
1. Nejrychlejší vstup.
2. Dolní odhad.
3. Příklad: prvek první. | complexity |
O(n log n) grows slower than O(n^2). | {
"A": "O(n)",
"B": "O(log n)",
"C": "O(n^2)",
"D": "O(1)"
} | cs_0170 | multiple_choice | en | Which is slower than O(n log n)? | [
"Compare growth.",
"Quadratic exceeds.",
"Select option C."
] | computer_science | Answer: O(n^2).
Steps:
1. Compare growth.
2. Quadratic exceeds.
3. Select option C.
Answer: (C) | complexity |
Big-Theta bounds growth tightly from both sides. | null | cs_0171 | concept | en | What is Big-Theta notation? | [
"Upper and lower.",
"Tight bound.",
"Example: Theta(n log n)."
] | computer_science | Answer: Tight bound.
Steps:
1. Upper and lower.
2. Tight bound.
3. Example: Theta(n log n). | complexity |
log2(1,000,000) is about 20, since 2^20 = 1,048,576. | null | cs_0172 | worked_example | en | About how many binary search steps for n = 1,000,000? | [
"Steps = log2(n).",
"2^20 ≈ 1,000,000.",
"About 20 steps."
] | computer_science | Answer: 20.
Steps:
1. Steps = log2(n).
2. 2^20 ≈ 1,000,000.
3. About 20 steps. | complexity |
Smyčka O(n) s n = 1000 udělá 1000 kroků. | null | cs_0173 | worked_example | cs | Kolik kroků má smyčka O(n) pro n = 1000? | [
"Jeden průchod na prvek.",
"n = 1000.",
"Celkem 1000 kroků."
] | computer_science | Answer: 1000.
Steps:
1. Jeden průchod na prvek.
2. n = 1000.
3. Celkem 1000 kroků. | complexity |
Big-O drops constant factors and keeps growth shape. | {
"A": "Counted exactly",
"B": "Ignored",
"C": "Doubled",
"D": "Logged"
} | cs_0174 | multiple_choice | en | What happens to constants in Big-O? | [
"Only growth matters.",
"Constants dropped.",
"Select option B."
] | computer_science | Answer: Ignored.
Steps:
1. Only growth matters.
2. Constants dropped.
3. Select option B.
Answer: (B) | complexity |
O(2^n) doubles work per added input, exploding fast. | null | cs_0175 | concept | en | What is exponential complexity? | [
"Doubles per input.",
"Example: subsets.",
"Infeasible past n ~ 30."
] | computer_science | Answer: Doubling per input.
Steps:
1. Doubles per input.
2. Example: subsets.
3. Infeasible past n ~ 30. | complexity |
10 items have 2^10 = 1024 subsets. | null | cs_0176 | worked_example | en | How many subsets does a 10-item set have? | [
"Each item in or out.",
"Total = 2^10.",
"Subsets = 1024."
] | computer_science | Answer: 1024.
Steps:
1. Each item in or out.
2. Total = 2^10.
3. Subsets = 1024. | complexity |
O(2^n) outgrows all polynomial bounds. | {
"A": "O(n^2)",
"B": "O(n^3)",
"C": "O(n log n)",
"D": "O(2^n)"
} | cs_0177 | multiple_choice | en | Which grows fastest? | [
"Exponential beats polynomial.",
"2^n wins.",
"Select option D."
] | computer_science | Answer: O(2^n).
Steps:
1. Exponential beats polynomial.
2. 2^n wins.
3. Select option D.
Answer: (D) | complexity |
Exponenciální složitost zdvojnásobuje práci s každým vstupem. | null | cs_0178 | concept | cs | Co je exponenciální složitost? | [
"Dvojnásobek na vstup.",
"Příklad: podmnožiny.",
"Nezvládnutelná pro velká n."
] | computer_science | Answer: Dvojnásobení na vstup.
Steps:
1. Dvojnásobek na vstup.
2. Příklad: podmnožiny.
3. Nezvládnutelná pro velká n. | complexity |
O(n) needs 1e6 steps while O(n^2) needs 1e12 for n = 1e6. | null | cs_0179 | worked_example | en | Compare O(n) vs O(n^2) steps for n = 1,000,000. | [
"O(n): 1,000,000.",
"O(n^2): 10^12.",
"Quadratic is a trillion."
] | computer_science | Answer: 1e6 vs 1e12.
Steps:
1. O(n): 1,000,000.
2. O(n^2): 10^12.
3. Quadratic is a trillion. | complexity |
NP-complete problems are the hardest in NP. | {
"A": "Hardest in NP",
"B": "Easy",
"C": "Unsolvable",
"D": "Linear"
} | cs_0180 | multiple_choice | en | What does NP-complete mean? | [
"In NP class.",
"All NP reduces to it.",
"Select option A."
] | computer_science | Answer: Hardest in NP.
Steps:
1. In NP class.
2. All NP reduces to it.
3. Select option A.
Answer: (A) | complexity |
Doubly linked lists add backward pointers for two-way traversal. | null | cs_0181 | concept | en | What is a doubly linked list? | [
"Each node two links.",
"Forward and back.",
"Costs extra memory."
] | computer_science | Answer: Two-way linked nodes.
Steps:
1. Each node two links.
2. Forward and back.
3. Costs extra memory. | data_structures |
Backward links allow traversal both ways. | {
"A": "Forward only",
"B": "Both directions",
"C": "Random only",
"D": "No traversal"
} | cs_0182 | multiple_choice | en | How can doubly lists traverse? | [
"Two pointers exist.",
"Both ways work.",
"Select option B."
] | computer_science | Answer: Both directions.
Steps:
1. Two pointers exist.
2. Both ways work.
3. Select option B.
Answer: (B) | data_structures |
Popping after pushing 1, 2 gives 2 then 1. | null | cs_0183 | worked_example | en | Push 1, 2 onto a stack, pop twice. What order? | [
"Top is 2: pop 2.",
"Top is 1: pop 1.",
"Order 2, 1."
] | computer_science | Answer: 2, 1.
Steps:
1. Top is 2: pop 2.
2. Top is 1: pop 1.
3. Order 2, 1. | data_structures |
Spojový seznam spojuje uzly ukazateli. | null | cs_0184 | concept | cs | Co je spojový seznam? | [
"Uzly s daty.",
"Ukazatele na další.",
"Rychlé vkládání."
] | computer_science | Answer: Uzly s ukazateli.
Steps:
1. Uzly s daty.
2. Ukazatele na další.
3. Rychlé vkládání. | data_structures |
Hash tables average O(1) lookup via direct indexing. | {
"A": "O(1)",
"B": "O(n)",
"C": "O(log n)",
"D": "O(n^2)"
} | cs_0185 | multiple_choice | en | What is average hash lookup time? | [
"Hash to slot.",
"Direct access.",
"Select option A."
] | computer_science | Answer: O(1).
Steps:
1. Hash to slot.
2. Direct access.
3. Select option A.
Answer: (A) | data_structures |
Load factor is 6/8 = 0.75. | null | cs_0186 | worked_example | en | 6 items in 8 slots. What is the load factor? | [
"Divide items by slots.",
"6/8 = 0.75.",
"Load = 0.75."
] | computer_science | Answer: 0.75.
Steps:
1. Divide items by slots.
2. 6/8 = 0.75.
3. Load = 0.75. | data_structures |
A BST orders keys left-smaller, right-larger; plain trees do not. | null | cs_0187 | concept | en | How do binary trees and BSTs differ? | [
"Binary: two children.",
"BST adds ordering.",
"Ordering enables search."
] | computer_science | Answer: Ordering rule added.
Steps:
1. Binary: two children.
2. BST adds ordering.
3. Ordering enables search. | data_structures |
Vyvážený strom se 7 uzly má hloubku 3. | null | cs_0188 | worked_example | cs | Jaká je hloubka vyváženého stromu se 7 uzly? | [
"Úrovně: 1, 2, 4.",
"Celkem 7 uzlů.",
"Hloubka = 3."
] | computer_science | Answer: 3.
Steps:
1. Úrovně: 1, 2, 4.
2. Celkem 7 uzlů.
3. Hloubka = 3. | data_structures |
Children of node i sit at 2i+1 and 2i+2 in array heaps. | {
"A": "i+1, i+2",
"B": "2i, 2i+1",
"C": "2i+1, 2i+2",
"D": "i/2"
} | cs_0189 | multiple_choice | en | Where are children in an array heap? | [
"Zero-based array.",
"Left 2i+1, right 2i+2.",
"Select option C."
] | computer_science | Answer: 2i+1, 2i+2.
Steps:
1. Zero-based array.
2. Left 2i+1, right 2i+2.
3. Select option C.
Answer: (C) | data_structures |
Adjacency lists store neighbors per node; matrices store a full V x V grid. | null | cs_0190 | concept | en | How do adjacency lists and matrices differ? | [
"Lists: per-node neighbors.",
"Matrix: full grid.",
"Lists save sparse space."
] | computer_science | Answer: Neighbors versus grid.
Steps:
1. Lists: per-node neighbors.
2. Matrix: full grid.
3. Lists save sparse space. | data_structures |
K5 has 5 x 4 / 2 = 10 edges. | null | cs_0191 | worked_example | en | How many edges in complete graph K5? | [
"Formula: n(n-1)/2.",
"Substitute: 5x4/2.",
"Edges = 10."
] | computer_science | Answer: 10.
Steps:
1. Formula: n(n-1)/2.
2. Substitute: 5x4/2.
3. Edges = 10. | data_structures |
A V x V matrix uses O(V^2) space. | {
"A": "O(V)",
"B": "O(E)",
"C": "O(V+E)",
"D": "O(V^2)"
} | cs_0192 | multiple_choice | en | What space does an adjacency matrix use? | [
"V rows, V cols.",
"V squared cells.",
"Select option D."
] | computer_science | Answer: O(V^2).
Steps:
1. V rows, V cols.
2. V squared cells.
3. Select option D.
Answer: (D) | data_structures |
Halda je strom, kde rodič je menší (či větší) než děti. | null | cs_0193 | concept | cs | Co je halda (heap)? | [
"Stromová struktura.",
"Rodič extrémní.",
"Kořen minimum či maximum."
] | computer_science | Answer: Strom s extrémem.
Steps:
1. Stromová struktura.
2. Rodič extrémní.
3. Kořen minimum či maximum. | data_structures |
Heaps give O(log n) priority queue operations. | {
"A": "Stack",
"B": "Heap",
"C": "Queue",
"D": "Array"
} | cs_0194 | multiple_choice | en | What implements a priority queue? | [
"Need min/max fast.",
"Heap provides it.",
"Select option B."
] | computer_science | Answer: Heap.
Steps:
1. Need min/max fast.
2. Heap provides it.
3. Select option B.
Answer: (B) | data_structures |
Inserting 5, 3, 4 into a min-heap leaves root 3. | null | cs_0195 | worked_example | en | Insert 5, 3, 4 into a min-heap. What is the root? | [
"Insert 5: root 5.",
"Insert 3: bubbles to root.",
"Insert 4: root stays 3."
] | computer_science | Answer: 3.
Steps:
1. Insert 5: root 5.
2. Insert 3: bubbles to root.
3. Insert 4: root stays 3. | data_structures |
String methods like upper() and split() transform text. | null | cs_0196 | concept | en | What do Python string methods do? | [
"upper() capitalizes.",
"split() divides.",
"strip() trims."
] | computer_science | Answer: Transform text.
Steps:
1. upper() capitalizes.
2. split() divides.
3. strip() trims. | python |
'a,b'.split(',') gives ['a', 'b']. | {
"A": "['a','b']",
"B": "'ab'",
"C": "['a,b']",
"D": "Error"
} | cs_0197 | multiple_choice | en | What does 'a,b'.split(',') return? | [
"Split on comma.",
"Two parts.",
"Select option A."
] | computer_science | Answer: ['a','b'].
Steps:
1. Split on comma.
2. Two parts.
3. Select option A.
Answer: (A) | python |
'hello'.upper() returns 'HELLO'. | null | cs_0198 | worked_example | en | What does 'hello'.upper() return? | [
"Capitalize each letter.",
"Result HELLO.",
"Returns 'HELLO'."
] | computer_science | Answer: 'HELLO'.
Steps:
1. Capitalize each letter.
2. Result HELLO.
3. Returns 'HELLO'. | python |
Řetězec je neměnná posloupnost znaků. | null | cs_0199 | concept | cs | Co je řetězec (str)? | [
"Posloupnost znaků.",
"Neměnný typ.",
"Metody upper, split."
] | computer_science | Answer: Neměnné znaky.
Steps:
1. Posloupnost znaků.
2. Neměnný typ.
3. Metody upper, split. | python |
list.append mutates in place and returns None. | {
"A": "New list",
"B": "Length",
"C": "None",
"D": "True"
} | cs_0200 | multiple_choice | en | What does append() return? | [
"Mutates in place.",
"No value built.",
"Select option C."
] | computer_science | Answer: None.
Steps:
1. Mutates in place.
2. No value built.
3. Select option C.
Answer: (C) | python |
append() adds one item while extend() adds each item from an iterable. | null | cs_0201 | concept | en | How do append() and extend() differ? | [
"append takes one object.",
"extend iterates input.",
"Use extend to merge lists."
] | computer_science | Answer: One item versus many.
Steps:
1. append takes one object.
2. extend iterates input.
3. Use extend to merge lists. | python |
[1,2,3].length is 3. | {
"A": "2",
"B": "3",
"C": "4",
"D": "undefined"
} | cs_0202 | multiple_choice | en | What does [1,2,3].length return? | [
"Count elements.",
"Three items.",
"Select option B."
] | computer_science | Answer: 3.
Steps:
1. Count elements.
2. Three items.
3. Select option B.
Answer: (B) | javascript |
SELECT 7 * 6 returns 42. | null | cs_0203 | worked_example | en | What does SELECT 7 * 6 return? | [
"Multiply 7 by 6.",
"7 x 6 = 42.",
"Result is 42."
] | computer_science | Answer: 42.
Steps:
1. Multiply 7 by 6.
2. 7 x 6 = 42.
3. Result is 42. | sql |
A /26 network has 62 usable hosts. | null | cs_0204 | worked_example | en | How many usable hosts in a /26 network? | [
"Host bits = 32 - 26 = 6.",
"Addresses = 2^6 = 64.",
"Usable = 64 - 2 = 62."
] | computer_science | Answer: 62.
Steps:
1. Host bits = 32 - 26 = 6.
2. Addresses = 2^6 = 64.
3. Usable = 64 - 2 = 62. | networking |
C v ACID znamená konzistence. | {
"A": "Atomicita",
"B": "Konzistence",
"C": "Izolace",
"D": "Trvanlivost"
} | cs_0205 | multiple_choice | cs | Co znamená C v ACID? | [
"ACID vlastnosti.",
"C je konzistence.",
"Vyber možnost B."
] | computer_science | Answer: Konzistence.
Steps:
1. ACID vlastnosti.
2. C je konzistence.
3. Vyber možnost B.
Answer: (B) | databases |
A context switch saves one process state and restores another. | null | cs_0206 | concept | en | What is a context switch? | [
"Save registers and state.",
"Load next process.",
"Resume execution."
] | computer_science | Answer: Swap running process.
Steps:
1. Save registers and state.
2. Load next process.
3. Resume execution. | operating_systems |
Balance starts at 100, deposit 50 gives 150. | null | cs_0207 | worked_example | en | Account balance 100, deposit(50). What is the balance? | [
"Start at 100.",
"Add 50.",
"Balance = 150."
] | computer_science | Answer: 150.
Steps:
1. Start at 100.
2. Add 50.
3. Balance = 150. | oop |
BFS finds shortest paths in unweighted graphs. | {
"A": "Dijkstra",
"B": "BFS",
"C": "DFS",
"D": "Merge sort"
} | cs_0208 | multiple_choice | en | Which finds shortest path in unweighted graphs? | [
"Unweighted edges.",
"BFS level order.",
"Select option B."
] | computer_science | Answer: BFS.
Steps:
1. Unweighted edges.
2. BFS level order.
3. Select option B.
Answer: (B) | algorithms |
Worst-case analysis bounds runtime over all inputs of size n. | null | cs_0209 | concept | en | What is worst-case analysis? | [
"Consider all inputs.",
"Take maximum cost.",
"Guarantees an upper bound."
] | computer_science | Answer: Maximum over inputs.
Steps:
1. Consider all inputs.
2. Take maximum cost.
3. Guarantees an upper bound. | complexity |
Pop vrátí 6, protože zásobník je LIFO. | null | cs_0210 | worked_example | cs | Zásobník obsahuje 5, 6. Co vrátí pop()? | [
"Nahoře je 6.",
"Pop odebere 6.",
"Výsledek je 6."
] | computer_science | Answer: 6.
Steps:
1. Nahoře je 6.
2. Pop odebere 6.
3. Výsledek je 6. | data_structures |
Tuples are immutable ordered sequences for fixed records. | null | cs_0211 | concept | en | What are Python tuples for? | [
"Ordered items.",
"Cannot change.",
"Good for records."
] | computer_science | Answer: Immutable records.
Steps:
1. Ordered items.
2. Cannot change.
3. Good for records. | python |
typeof 'hi' is 'string'. | {
"A": "string",
"B": "number",
"C": "object",
"D": "undefined"
} | cs_0212 | multiple_choice | en | What is typeof 'hi'? | [
"'hi' is text.",
"Type is string.",
"Select option A."
] | computer_science | Answer: string.
Steps:
1. 'hi' is text.
2. Type is string.
3. Select option A.
Answer: (A) | javascript |
COUNT returns 4 when 4 of 10 rows match. | null | cs_0213 | worked_example | en | Table has 10 rows, WHERE matches 4. What does COUNT(*) return? | [
"Filter to 4 rows.",
"Count them.",
"Result = 4."
] | computer_science | Answer: 4.
Steps:
1. Filter to 4 rows.
2. Count them.
3. Result = 4. | sql |
10.0.0.0/8 has 2^24 = 16777216 addresses. | null | cs_0214 | worked_example | en | How many addresses in 10.0.0.0/8? | [
"Host bits = 24.",
"Total = 2^24.",
"Addresses = 16777216."
] | computer_science | Answer: 16777216.
Steps:
1. Host bits = 24.
2. Total = 2^24.
3. Addresses = 16777216. | networking |
Řádky přidává příkaz INSERT. | {
"A": "SELECT",
"B": "INSERT",
"C": "DELETE",
"D": "UPDATE"
} | cs_0215 | multiple_choice | cs | Která operace přidává řádky? | [
"SELECT čte.",
"INSERT přidává.",
"Vyber možnost B."
] | computer_science | Answer: INSERT.
Steps:
1. SELECT čte.
2. INSERT přidává.
3. Vyber možnost B.
Answer: (B) | databases |
A system call is the interface for user programs to request kernel services. | null | cs_0216 | concept | en | What is a system call? | [
"User needs kernel help.",
"Trap to kernel.",
"Return result."
] | computer_science | Answer: Kernel service request.
Steps:
1. User needs kernel help.
2. Trap to kernel.
3. Return result. | operating_systems |
Square(5).area() returns 25. | null | cs_0217 | worked_example | en | Square side 5, area = s*s. What does Square(5).area() give? | [
"Side = 5.",
"Area = 5 x 5.",
"Result = 25."
] | computer_science | Answer: 25.
Steps:
1. Side = 5.
2. Area = 5 x 5.
3. Result = 25. | oop |
With early exit, sorted input needs one pass: O(n). | {
"A": "O(n)",
"B": "O(n^2)",
"C": "O(log n)",
"D": "O(1)"
} | cs_0218 | multiple_choice | en | What is bubble sort best case with early exit? | [
"Sorted input detected.",
"One pass.",
"Select option A."
] | computer_science | Answer: O(n).
Steps:
1. Sorted input detected.
2. One pass.
3. Select option A.
Answer: (A) | algorithms |
Amortized analysis averages cost over a sequence of operations. | null | cs_0219 | concept | en | What is amortized analysis? | [
"Many operations.",
"Average the cost.",
"Example: dynamic array."
] | computer_science | Answer: Average over sequence.
Steps:
1. Many operations.
2. Average the cost.
3. Example: dynamic array. | complexity |
Dequeue vrátí 1, protože fronta je FIFO. | null | cs_0220 | worked_example | cs | Fronta obsahuje 1, 2. Co vrátí dequeue? | [
"Vpředu je 1.",
"Dequeue odebere 1.",
"Výsledek je 1."
] | computer_science | Answer: 1.
Steps:
1. Vpředu je 1.
2. Dequeue odebere 1.
3. Výsledek je 1. | data_structures |
Dict comprehensions build dicts as {k: v for ...} in one line. | null | cs_0221 | concept | en | What is a dict comprehension? | [
"Loop inside braces.",
"Build key-value pairs.",
"Example: {x: x*x}."
] | computer_science | Answer: One-line dict builder.
Steps:
1. Loop inside braces.
2. Build key-value pairs.
3. Example: {x: x*x}. | python |
'5' - 2 is 3 because minus coerces to number. | {
"A": "'52'",
"B": "3",
"C": "'3'",
"D": "NaN"
} | cs_0222 | multiple_choice | en | What does '5' - 2 give in JavaScript? | [
"Minus coerces.",
"'5' becomes 5.",
"Select option B."
] | computer_science | Answer: 3.
Steps:
1. Minus coerces.
2. '5' becomes 5.
3. Select option B.
Answer: (B) | javascript |
SUM of (10, 20) is 30. | null | cs_0223 | worked_example | en | What does SELECT SUM(x) give for x in (10,20)? | [
"Add values.",
"10 + 20 = 30.",
"Result = 30."
] | computer_science | Answer: 30.
Steps:
1. Add values.
2. 10 + 20 = 30.
3. Result = 30. | sql |
A /30 has 2 usable hosts. | null | cs_0224 | worked_example | en | How many usable hosts in a /30 network? | [
"Host bits = 2.",
"Addresses = 4.",
"Usable = 4 - 2 = 2."
] | computer_science | Answer: 2.
Steps:
1. Host bits = 2.
2. Addresses = 4.
3. Usable = 4 - 2 = 2. | networking |
DELETE maže řádky z tabulky. | {
"A": "Maže řádky",
"B": "Přidává řádky",
"C": "Třídí řádky",
"D": "Spojuje tabulky"
} | cs_0225 | multiple_choice | cs | Co dělá příkaz DELETE? | [
"DELETE odstraňuje.",
"Maže vybrané řádky.",
"Vyber možnost A."
] | computer_science | Answer: Maže řádky.
Steps:
1. DELETE odstraňuje.
2. Maže vybrané řádky.
3. Vyber možnost A.
Answer: (A) | databases |
Virtual memory extends RAM using disk space with address translation. | null | cs_0226 | concept | en | What is virtual memory? | [
"Programs see large space.",
"OS maps to RAM or disk.",
"Enables bigger programs."
] | computer_science | Answer: RAM extended by disk.
Steps:
1. Programs see large space.
2. OS maps to RAM or disk.
3. Enables bigger programs. | operating_systems |
Person('Ann', 30).age is 30. | null | cs_0227 | worked_example | en | Person stores name and age. What is Person('Ann', 30).age? | [
"Name is Ann.",
"Age is 30.",
"Attribute age = 30."
] | computer_science | Answer: 30.
Steps:
1. Name is Ann.
2. Age is 30.
3. Attribute age = 30. | oop |
Merge sort guarantees O(n log n) worst case. | {
"A": "Quicksort",
"B": "Merge sort",
"C": "Bubble sort",
"D": "Insertion sort"
} | cs_0228 | multiple_choice | en | Which sort has O(n log n) worst case? | [
"Quicksort degrades.",
"Merge divides evenly.",
"Select option B."
] | computer_science | Answer: Merge sort.
Steps:
1. Quicksort degrades.
2. Merge divides evenly.
3. Select option B.
Answer: (B) | algorithms |
P contains problems solvable in polynomial time. | null | cs_0229 | concept | en | What is complexity class P? | [
"Polynomial time.",
"Efficiently solvable.",
"Example: sorting."
] | computer_science | Answer: Polynomial-time problems.
Steps:
1. Polynomial time.
2. Efficiently solvable.
3. Example: sorting. | complexity |
Prvek na indexu 1 je číslo 20. | null | cs_0230 | worked_example | cs | Pole je [10,20,30]. Co je prvek na indexu 1? | [
"Index 0 je 10.",
"Index 1 je 20.",
"Výsledek je 20."
] | computer_science | Answer: 20.
Steps:
1. Index 0 je 10.
2. Index 1 je 20.
3. Výsledek je 20. | data_structures |
F-strings embed expressions as f'{x}' evaluated at runtime. | null | cs_0231 | concept | en | What are Python f-strings? | [
"Prefix f.",
"Braces hold code.",
"Rendered as text."
] | computer_science | Answer: Embedded expressions.
Steps:
1. Prefix f.
2. Braces hold code.
3. Rendered as text. | python |
'abc'.toUpperCase() returns 'ABC'. | {
"A": "'ABC'",
"B": "'abc'",
"C": "'Abc'",
"D": "Error"
} | cs_0232 | multiple_choice | en | What does 'abc'.toUpperCase() return? | [
"Capitalize all.",
"Result ABC.",
"Select option A."
] | computer_science | Answer: 'ABC'.
Steps:
1. Capitalize all.
2. Result ABC.
3. Select option A.
Answer: (A) | javascript |
SELECT 100 - 37 returns 63. | null | cs_0233 | worked_example | en | What does SELECT 100 - 37 return? | [
"Subtract 37.",
"100 - 37 = 63.",
"Result is 63."
] | computer_science | Answer: 63.
Steps:
1. Subtract 37.
2. 100 - 37 = 63.
3. Result is 63. | sql |
A /25 network has 126 usable hosts. | null | cs_0234 | worked_example | en | How many usable hosts in a /25 network? | [
"Host bits = 7.",
"Addresses = 128.",
"Usable = 128 - 2 = 126."
] | computer_science | Answer: 126.
Steps:
1. Host bits = 7.
2. Addresses = 128.
3. Usable = 128 - 2 = 126. | networking |
SELECT DISTINCT odstraní duplicitní řádky. | {
"A": "Odstraní duplicity",
"B": "Seřadí řádky",
"C": "Spojí tabulky",
"D": "Smaže tabulku"
} | cs_0235 | multiple_choice | cs | Co dělá SELECT DISTINCT? | [
"DISTINCT filtruje.",
"Duplicity pryč.",
"Vyber možnost A."
] | computer_science | Answer: Odstraní duplicity.
Steps:
1. DISTINCT filtruje.
2. Duplicity pryč.
3. Vyber možnost A.
Answer: (A) | databases |
Deadlock is circular waiting where each process holds a needed resource. | null | cs_0236 | concept | en | What is a deadlock? | [
"Each waits.",
"Cycle of holders.",
"Nothing proceeds."
] | computer_science | Answer: Circular wait.
Steps:
1. Each waits.
2. Cycle of holders.
3. Nothing proceeds. | operating_systems |
B inherits x = 5 from A. | null | cs_0237 | worked_example | en | Class A defines x = 5, B(A) inherits. What is B().x? | [
"A sets x.",
"B inherits A.",
"B().x = 5."
] | computer_science | Answer: 5.
Steps:
1. A sets x.
2. B inherits A.
3. B().x = 5. | oop |
Binary search on 8 items needs at most 3 comparisons. | {
"A": "2",
"B": "3",
"C": "4",
"D": "8"
} | cs_0238 | multiple_choice | en | What is worst-case binary search comparisons for n = 8? | [
"log2(8) = 3.",
"Halve thrice.",
"Select option B."
] | computer_science | Answer: 3.
Steps:
1. log2(8) = 3.
2. Halve thrice.
3. Select option B.
Answer: (B) | algorithms |
Space-time tradeoff exchanges memory for speed or vice versa. | null | cs_0239 | concept | en | What is a space-time tradeoff? | [
"More memory, less time.",
"Or less memory, more time.",
"Example: caching."
] | computer_science | Answer: Memory versus speed.
Steps:
1. More memory, less time.
2. Or less memory, more time.
3. Example: caching. | complexity |
Minimum je v kořenu, tedy 3. | null | cs_0240 | worked_example | cs | Min-halda je [3,5,4]. Kde je minimum? | [
"Kořen je 3.",
"Děti větší.",
"Minimum je 3."
] | computer_science | Answer: 3.
Steps:
1. Kořen je 3.
2. Děti větší.
3. Minimum je 3. | data_structures |
Generators yield items lazily one at a time with yield. | null | cs_0241 | concept | en | What is a Python generator? | [
"Uses yield.",
"Lazy iteration.",
"Saves memory."
] | computer_science | Answer: Lazy iterator.
Steps:
1. Uses yield.
2. Lazy iteration.
3. Saves memory. | python |
[] + [] is '' (empty string). | {
"A": "''",
"B": "0",
"C": "[]",
"D": "NaN"
} | cs_0242 | multiple_choice | en | What does [] + [] give in JavaScript? | [
"Arrays to strings.",
"'' + ''.",
"Select option A."
] | computer_science | Answer: ''.
Steps:
1. Arrays to strings.
2. '' + ''.
3. Select option A.
Answer: (A) | javascript |
LENGTH('hello') is 5. | null | cs_0243 | worked_example | en | What does SELECT LENGTH('hello') return? | [
"Count letters.",
"h-e-l-l-o = 5.",
"Result = 5."
] | computer_science | Answer: 5.
Steps:
1. Count letters.
2. h-e-l-l-o = 5.
3. Result = 5. | sql |
Payload is 1500 - 20 = 1480 bytes. | null | cs_0244 | worked_example | en | Packet 1500 bytes, header 20. What is the payload size? | [
"Total 1500.",
"Minus header 20.",
"Payload = 1480."
] | computer_science | Answer: 1480.
Steps:
1. Total 1500.
2. Minus header 20.
3. Payload = 1480. | networking |
Data mění příkaz UPDATE. | {
"A": "SELECT",
"B": "UPDATE",
"C": "JOIN",
"D": "GROUP BY"
} | cs_0245 | multiple_choice | cs | Který příkaz mění existující data? | [
"SELECT čte.",
"UPDATE mění.",
"Vyber možnost B."
] | computer_science | Answer: UPDATE.
Steps:
1. SELECT čte.
2. UPDATE mění.
3. Vyber možnost B.
Answer: (B) | databases |
Paging splits memory into fixed-size pages and frames. | null | cs_0246 | concept | en | What is paging? | [
"Fixed blocks.",
"Pages map to frames.",
"Avoids fragmentation."
] | computer_science | Answer: Fixed-size blocks.
Steps:
1. Fixed blocks.
2. Pages map to frames.
3. Avoids fragmentation. | operating_systems |
Area = 3.14 x 1 x 1 = 3.14. | null | cs_0247 | worked_example | en | Circle radius 1, area = 3.14*r*r. What is the area? | [
"r = 1.",
"3.14 x 1 x 1.",
"Area = 3.14."
] | computer_science | Answer: 3.14.
Steps:
1. r = 1.
2. 3.14 x 1 x 1.
3. Area = 3.14. | oop |
Merge sort splits, sorts, and merges: divide and conquer. | {
"A": "Merge sort",
"B": "Bubble sort",
"C": "Linear search",
"D": "BFS"
} | cs_0248 | multiple_choice | en | Which is a divide-and-conquer algorithm? | [
"Split problem.",
"Merge solves.",
"Select option A."
] | computer_science | Answer: Merge sort.
Steps:
1. Split problem.
2. Merge solves.
3. Select option A.
Answer: (A) | algorithms |
Nested n x m loops cost O(n*m). | null | cs_0249 | concept | en | What is the complexity of n x m nested loops? | [
"Outer n.",
"Inner m.",
"Product n*m."
] | computer_science | Answer: O(n*m).
Steps:
1. Outer n.
2. Inner m.
3. Product n*m. | complexity |
Seznam má 3 uzly. | null | cs_0250 | worked_example | cs | Seznam je 1 -> 2 -> 3 -> None. Kolik má uzlů? | [
"Počítej 1, 2, 3.",
"Konec None.",
"Celkem 3 uzly."
] | computer_science | Answer: 3.
Steps:
1. Počítej 1, 2, 3.
2. Konec None.
3. Celkem 3 uzly. | data_structures |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.