Recent questions tagged goclasses-cs-dpp-day-315

6 6 votes
2 2 answers
226
226 views
The UNIX editor $\texttt{vi}$ allows searching in both directions, and if the search reaches one end, it wraps around and continues from the other end.If the sequence of ...
6 6 votes
3 3 answers
228
228 views
A circular linked list has $n$ nodes. A function prints every node exactly once and stops when it reaches the starting node again.What is the running time of printing the...
6 6 votes
2 2 answers
272
272 views
A singly linked list contains $n$ nodes. We want to reverse the order of the elements in the linked list by changing links, not by copying all elements into an array.Whic...
7 7 votes
2 2 answers
250
250 views
The following function is supposed to reverse a singly linked list:struct node { int data; struct node *next; }; static void reverse(struct node head_ref) { struct node ...
8 8 votes
2 2 answers
246
246 views
Consider the following C-style code fragment for reversing a non-empty singly linked list:curr = front; next = curr->next; prev = NULL; while (curr != NULL) { (*) } front...
5 5 votes
3 3 answers
364
364 views
Consider the DFA over $\Sigma = \{a,b\}$ with states $q_0,q_1,q_2,q_3,q_4$. The start state is $q_0$, and the final states are $q_2$ and $q_4$. The transition function is...
6 6 votes
5 5 answers
329
329 views
Consider the following finite state machine $A$Which modification makes it a DFA for $L = \{w \in \{a,b\}^* \mid w$ starts with $a$ and has exactly two $a$'s$\}$?Replace ...
5 5 votes
2 2 answers
204
204 views
Consider a DFA with three states: $I$, $F$, and $D$. $I$ is the initial state, $F$ is the only final state, and $D$ is a dead state. The transitions are: $$\begin{array}{...
7 7 votes
1 1 answer
197
197 views
The following DFA accepts all those strings in which number of $1$'s and $0$'s areDivisible by $3$ and $2$ respectively. Odd and Even respectively. Even and Odd respectiv...
4 4 votes
2 2 answers
229
229 views
Two finite state machines are said to be equivalent if they:Have the same number of edges Have the same number of states Recognize the same set of strings Have the same n...
To see more, click for the full list of questions or popular tags.