MOCK TEST : SET 4

COMPUTER SCIENCE

Countdown Timer

Time remaining:

SET 4 COMPUTER SCIENCE

  1. In a compiler, keywords of a language are recognized during

  2. An algorithm to find the length of the longest monotonically increasing sequence starting at index i in the array.

  3. How many distinct stages are there in DES algorithm, which is parameterized by a 56-bit key ?

  4. When data and acknowledgement are sent in the same frame, this is called as

  5. Given the following statements:
    S1: A foreign key declaration can always be replaced by an equivalent check assertion in SQL.
    S2: Given the table R(a,b,c) where a and b together form the primary key, the following is a valid table definition.
    CREATE TABLE S (
    a INTEGER,
    d INTEGER,
    e INTEGER,
    PRIMARY KEY (d),
    FOREIGN KEY (a) references R)
    Which one of the following statements is CORRECT?

  6. A relational schema for a train reservation database is given below:
    Passenger ( pid, pname, age)
    Reservation (pid, cass, tid)

    What pids are returned by the following SQL query for the above instance of the tables? SELECT pid FROM Reservation WHERE class 'AC' AND EXISTS (SELECT * FROM Passenger WHERE age > 65 AND Passenger.pid = Reservation.pid);

  7. Consider the following tree

  8. A binary tree in which every non-leaf node has non-empty left and right subtrees is called a strictly binary tree. Such a tree with 10 leaves.

  9. The most appropriate matching for the following pairs
    X: m=malloc(5); m= NULL;
    Y: free(n); n->value = 5;
    Z: char *p; *p=’a’;
    1: using dangling
    2: using uninitialized pointers
    3. lost memory
    is:

  10. To put the 8085 microprocessor in the wait state

  11. The most appropriate matching for the following pairs
    X: Indirect addressing 1 : Loops
    Y: Immediate addressing 2 : Pointers
    Z: Auto decrement addressing 3: Constants
    is

  12. Match the following vi commands in Unix:

  13. Which of the following commands or sequences of commands will rename a file x to file y in a Unix system?
    I. mv y, x
    II. mv x, y
    III. cp y, x (rm x)
    IV. cp x, y (rm x)

  14. A disk has 200 tracks (numbered 0 through 199). At a given time, it was servicing the request of reading data from track 120, and at the previous request, service was for track 90. The pending requests (in order of their arrival) are for track numbers.
    30 70 115 130 110 80 20 25.
    How many times will the head change its direction for the disk scheduling policies SSTF(Shortest Seek Time First) and FCFS (First Come First Serve)

  15. Match the following :

  16. Consider the languages L1 = ϕ and L2 = {a}. Which one of the following represents L1L2* U L1*?

  17. If a class B network on the Internet has a subnet mask of 255.255.248.0, what is the maximum number of hosts per subnet?

  18. In Cyrus-Beck algorithm for line clipping the value of t parameter is computed by the relation:
    (Here P 1 and P 2 are the two end points of the line, f is a point on the boundary, n 1 is inner normal)

  19. A priority queue is implemented as a Max-Heap. Initially, it has 5 elements. The level-order traversal of the heap is: 10, 8, 5, 3, 2. Two new elements 1 and 7 are inserted into the heap in that order. The level-order traversal of the heap after the insertion of the elements is:

  20. A text is made up of the characters a, b, c, d, e each occurring with the probability 0.11, 0.40, 0.16, 0.09 and 0.24 respectively. The optimal Huffman coding technique will have the average length of:

  21. consider an open address hash table with a total of 10000 slots containing 9800 entries.

  22. A counting semaphore is initialized to 8. 3 wait() operations and 4 signal() operations are applied. Find the current value of semaphore variable.

  23. A* algorithm is guaranteed to find an optimal solution if

  24. Consider a system with byte-addressable memory, 32 bit logical addresses, 4 kilobyte page size and page table entries of 4 bytes each. The size of the page table in the system in megabytes is ___________