UGC NET Paper 2 (Computer Science)Hard
The language {a^n b^n | n >= 0} is:
- A. Regular but not context-free
- B. Context-free but not regular
- C. Neither context-free nor regular
- D. Both regular and context-free
Correct answer: B. Context-free but not regular
The pumping lemma for regular languages disproves regularity while a simple CFG S -> aSb | e generates it.
Practise more UGC NET Computer Science and Applications questionsUGC NET Computer Science and Applications: notes and key points
More UGC NET Computer Science and Applications questions
- A graph has 13 vertices, 17 edges and is connected. Its cyclomatic number (number of independent cycles) is:
- The Floyd cycle-detection (tortoise and hare) method finds a cycle in a linked list using:
- For the reference string 7,0,1,2,0,3,0,4,2,3,0,3,2,1,2,0,1,7,0,1 and 3 frames, the number of page faults under LRU is:
- A TLB lookup takes 20 ns, a memory access 100 ns and the TLB hit ratio is 90%. The effective access time (single-level paging) is:
- A system has a 32-bit virtual address, 4 KB pages and 4-byte page table entries with a single-level page table. The page table size is:
- In the bounded-buffer producer-consumer solution with n slots, the semaphores empty, full and mutex are initialised respectively to: