Question Detail: So I thought this (though somewhat basic) question belonged here: Say I have a graph of size 100 nodes arrayed in a 10×10 pattern (think chessboard). The graph is undirected, and unweighted. Moving through the graph involves moving three Read More …
Category: Uncategorized
Is Morse Code binary, ternary or quinary?
Question Detail: I am reading the book: “Code: The Hidden Language of Computer Hardware and Software” and in Chapter 2 author says: Morse code is said to be a binary (literally meaning two by two) code because the components of the Read More …
Convert DFA to Regular Expression
Question Detail: In this old exam-task I don’t understand all the steps to convert the DFA below to a Regular Expression. The $q_2$ state is eliminated first. The provided solution to eliminate $q_2$ is: If we first eliminate $q_2$ we obtain Read More …
How does an admissible heuristic ensure an optimal solution?
Question Detail: When using A* or any other best path finding algorithm we say that the heuristic used should be admissible i.e. it should never overestimate the actual solution path (moves). Can someone tell me how this is true? Please avoid Read More …
Doubt regarding cache hit ratios and access time
Question Detail: Question 1: What is the average access time for a 3-level memory system with access time $T_1$, $2T_1$ and $3T_1$? (Hit ratio $h_1$ = $h_2$ = 0.9) The solution given is: $0.9[T_1] + 0.1(0.9[2*T_1] + 0.1[3*T_1]) = 1.11[T_1]$ (Method Read More …
Selection Sort runtime in terms of Big O
Question Detail: I’m trying to understand why the sorting algorithm Selection Sort has asymptotic runtime in $O(n^2)$. Looking at the math, the runtime is $qquad T(n) = (n-1) + (n-2) + dots + 2 + 1$. And this is stated to Read More …
Deletion in min/max heaps
Question Detail: I think I’m confused about deletion in heaps, and since I have an exam today, I’m looking for your help to correct me. I will post photos since it will makes it a bit more clear. Note(forget about deleting Read More …
Why is it best to use a prime number as a mod in a hashing function?
Question Detail: If I have a list of key values from 1 to 100 and I want to organize them in an array of 11 buckets, I’ve been taught to form a mod function $$ H = k bmod 11$$ Now Read More …
What is pass-by-value-result and its advantage and disadvantage?
Question Detail: I have searched on Google, but I can’t quite understand what is pass-by-value-result. What is the advantage and disadvantage of using pass-by-value-result? If I have a program code like this, what will be the result when parameters are passed Read More …
How does increasing the page size affect the number of page faults?
Question Detail: If we let the physical memory size remain constant, What effect does the size of the page have on the number of frames? What effect does the number of frames have on the number of page faults? Also, please Read More …