Multiple choice
2 marks
Theory of Computation
2014
Let \(L_1 = \{w \in \{0,1\}^* \mid w\) has at least as many occurrences of (110)'s as (011)'s\(\}\). Let \(L_2 = \{w \in \{0,1\}^* \mid w\) has at least as many occurrences of (000)'s as (111)'s\(\}\). Which one of the following is TRUE?
Multiple choice
2 marks
Theory of Computation
2012
Which of the following problems are decidable?Does a given program ever produce an output?If \(L\) is a context-free language, then is \(\bar{L}\) also context-free?If \(L\) is a regular language, then is \(\bar{L}\) also regular?If \(L\) is a recursive…
Multiple choice
2 marks
Theory of Computation
2010
Let \(L = \{w \in (0+1)^* \mid w\) has an even number of 1s\(\}\), i.e. \(L\) is the set of all bit strings with an even number of 1s. Which one of the regular expressions below represents \(L\)?
Multiple choice
2 marks
Theory of Computation
2007
A minimum state deterministic finite automaton accepting the language \(L = \{w \mid w \in \{0,1\}^*\), number of 0s and 1s in \(w\) are divisible by 3 and 5, respectively\(\}\) has
Multiple choice
2 marks
Theory of Computation
2005
Consider the languages \(L_1 = \{a^n b^n c^m \mid n, m > 0\}\) and \(L_2 = \{a^n b^m c^m \mid n, m > 0\}\). Which one of the following statements is FALSE?
Numerical answer
1 mark
Programming and Data Structures
2019
Consider the following C program:#include <stdio.h> int jumble(int x, int y) { x = 2 * x + y; return x; } int main() { int x =…
Multiple choice
2 marks
Programming and Data Structures
2018
Consider the following C program:#include <stdio.h> struct Ournode { char x, y, z; }; int main() { struct Ournode p = {'1', '0', 'a' + 2}; struct Ournode…
Multiple choice
1 mark
Programming and Data Structures
2016
Consider the following C program:void f(int, short); void main() { int i = 100; short s = 12; short *p = &s; __________ ; /* call to f()…
Numerical answer
2 marks
Programming and Data Structures
2017
Consider the following C program:#include <stdio.h> int *A, stkTop; int stkFunc(int opcode, int val) { static int size = 0, stkTop = 0; switch (opcode) { case -1:…
Multiple choice
2 marks
Programming and Data Structures
2015
Consider a max-heap stored in an array using the usual level-order (breadth-first) representation:40, 30, 20, 10, 15, 16, 17, 8, 4The value 35 is now inserted into this…