Question
stringlengths 39
1.33k
| Tag
stringlengths 3
46
| label
int64 0
206
|
---|---|---|
The following postfix expression with single digit operands is evaluated using a stack 8 2 3 hat 2 3 5 1 Note that hat is the exponentiation operator The top two elements of the stack after the first is evaluated are 6 1 5 7 3 2 1 5 | Stack | 174 |
The best data structure to check whether an arithmetic expression has balanced parentheses is a queue stack tree list | Stack | 174 |
Suppose a stack implementation supports in addition to PUSH and POP an operation REVERSE which reverses the order of the elements on the stack To implement a queue using the above stack implementation show how to implement ENQUEUE using a single operation and DEQUEUE using a sequence of 3 operations The following post fix expression containing single digit operands and arithmetic operators and is evaluated using a stack 5 2 3 4 5 2 Show the contents of the stack After evaluating 5 2 3 4 After evaluating 5 2 3 4 5 2 At the end of evaluation | Stack | 174 |
Suppose a stack implementation supports an instruction REVERSE which reverses the order of elements on the stack in addition to the PUSH and POP instructions Which one of the following statements is TRUE with respect to this modified stack A queue cannot be implemented using this stack A queue can be implemented where ENQUEUE takes a single instruction and DEQUEUE takes a sequence of two instructions A queue can be implemented where ENQUEUE takes a sequence of three instructions and DEQUEUE takes a single instruction A queue can be implemented where both ENQUEUE and DEQUEUE take a single instruction each | Stack | 174 |
Let S be a stack of size n geq1 Starting with the empty stack suppose we push the first n natural numbers in sequence and then perform n pop operations Assume that Push and Pop operations take X seconds each and Y seconds elapse between the end of one such stack operation and the start of the next operation For m geq1 define the stack life of m as the time elapsed from the end of Push m to the start of the pop operation that removes m from S The average stack life of an element of this stack is n X Y 3Y 2X n X Y X Y 2X | Stack | 174 |
Consider the following C program include lt stdio h gt define EOF 1 void push int push the argument on the stack int pop void pop the top of the stack void flagError int main int c m n r while c getchar EOF if isdigit c push c else if c c m pop n pop r c n m n m push r else if c flagError printf c pop What is the output of the program for the following input 5 2 3 3 2 15 25 30 150 | Stack | 174 |
Choose the correct alternatives more than one may be correct and write the corresponding letters only The following sequence of operations is performed on a stack PUSH 10 PUSH 20 POP PUSH 10 PUSH 20 POP POP POP PUSH 20 POP The sequence of values popped out is 20 10 20 10 20 20 20 10 10 20 10 20 20 10 20 20 20 10 20 10 | Stack | 174 |
Assume that the operators imes are left associative and hat is right associative The order of precedence from highest to lowest is hat imes The postfix expression corresponding to the infix expression a b imes c d hat e hat f is abc imes def hat hat abc imes de hat f hat ab c imes d e hat f hat a imes bc hat hat def | Stack | 174 |
A single array A 1 MAXSIZE is used to implement two stacks The two stacks grow from opposite ends of the array Variables top1 and top2 top lt top 2 point to the location of the topmost element in each of the stacks If the space is to be used efficiently the condition for u201cstack full u201d is top1 MAXSIZE 2 and top2 MAXSIZE 2 1 top1 top2 MAXSIZE top1 MAXSIZE 2 or top2 MAXSIZE top1 top2 1 | Stack | 174 |
A program attempts to generate as many permutations as possible of the string abcd by pushing the characters a b c d in the same order onto a stack but it may pop off the top character at any time Which one of the following strings CANNOT be generated using this program abcd dcba cbad cabd | Stack | 174 |
A function f defined on stacks of integers satisfies the following properties f u2205 0 and f push S i max f S 0 i for all stacks S and integers i If a stack S contains the integers 2 3 2 1 2 in order from bottom to top what is f S 6 4 3 2 | Stack | 174 |
Consider the C program below include lt stdio h gt int A stkTop int stkFunc int opcode int val static int size 0 stkTop 0 switch opcode case 1 size val break case 0 if stkTop lt size A stkTop val break default if stkTop return A stkTop return 1 int main int B 20 A B stkTop 1 stkFunc 1 10 stkFunc 0 5 stkFunc 0 10 printf d stkFunc 1 0 stkFunc 1 0 The value printed by the above program is ________ | Stack | 174 |
Based on the given statements select the most appropriate option to solve the given question If two floors in a certain building are 9 feet apart how many steps are there in a set of stairs that extends from the first floor to the second floor of the building Statements I Each step is 3 4 foot high II Each step is 1 foot wide Statements I alone is sufficient but statement II alone is not sufficient Statements II alone is sufficient but statement I alone is not sufficient Both statements together are sufficient but neither statement alone is sufficient Statements I and II together are not sufficient | Statement Sufficiency | 175 |
Consider a Boolean function f w x y z Suppose that exactly one of its inputs is allowed to change at a time If the function happens to be true for two input vectors i_ 1 left langle w_ 1 x_ 1 y_ 1 z_ 1 right rangle and i_ 2 left langle w_ 2 x_ 2 y_ 2 z_ 2 right rangle we would like the function to remain true as the input changes from i_ 1 to i_ 2 i_ 1 and i_ 2 differ in exactly one bit position without becoming false momentarily Let f w x y z sum 5 7 11 12 13 15 Which of the following cube covers of f will ensure that the required property is satisfied overline w xz wx overline y x overline y z xyz wyz wxy overline w xz wyz wx overline y overline z xz w overline x yz wx overline y wyz wxz overline w xz x overline y z xyz | Static Hazard | 176 |
The values of parameters for the Stop and Wait ARQ protocol are as given below Bit rate of the transmission channel 1 Mbps Propagation delay from sender to receiver 0 75 ms Time to process a frame 0 25 ms Number of bytes in the information frame 1980 Number of bytes in the acknowledge frame 20 Number of overhead bytes in the information frame 20 Assume there are no transmission errors Then the transmission efficiency expressed in percentage of the Stop and Wait ARQ protocol for the above parameters is _____________ correct to 2 decimal places | Stop And Wait | 177 |
Suppose that the stop and wait protocol is used on a link with a bit rate of 64 kilobits per second and 20 milliseconds propagation delay Assume that the transmission time for the acknowledgement and the processing time at nodes are negligible Then the minimum frame size in bytes to achieve a link utilization of at least 50 is_________________ | Stop And Wait | 177 |
On a wireless link the probability of packet error is 0 2 A stop and wait protocol is used to transfer data across the link The channel condition is assumed to be independent from transmission to transmission What is the average number of transmission attempts required to transfer 100 packets 100 125 150 200 | Stop And Wait | 177 |
A sender uses the Stop and Wait ARQ protocol for reliable transmission of frames Frames are of size 1000 bytes and the transmission rate at the sender is 80 Kbps 1 Kbps 1000 bits second Size of an acknowledgement is 100 bytes and the transmission rate at the receiver is 8 Kbps The one way propagation delay is 100 milliseconds Assuming no frame is lost the sender throughout is ________ bytes second | Stop And Wait | 177 |
Consider the following relations A B and C A Id Name Age 12 Arun 60 15 Shreya 24 99 Rohit 11 B Id Name Age 15 Shreya 24 25 Hari 40 98 Rohit 20 99 Rohit 11 C Id Phone Area 10 2200 02 99 2100 01 How many tuples does the result of the following SQL query contain SELECT A Id FROM A WHERE A Age gt ALL SELECT B Age FROM B WHERE B Name lsquo Arun rsquo 4 3 0 1 | Sub Queries | 178 |
Consider the following relational schema ext Suppliers underline ext sid integer ext sname string city string street string ext Parts underline ext pid integer ext pname string color string ext Catalog underline ext sid integer pid integer ext cost real Consider the following relational query on the above database SELECT S sname FROM Suppliers S WHERE S sid NOT IN SELECT C sid FROM Catalog C WHERE C pid NOT IN SELECT P pid FROM Parts P WHERE P color lt gt blue Assume that relations corresponding to the above schema are not empty Which one of the following is the correct interpretation of the above query Find the names of all suppliers who have supplied a non blue part Find the names of all suppliers who have not supplied a non blue part Find the names of all suppliers who have supplied only non blue part Find the names of all suppliers who have not supplied only blue parts | Sub Queries | 178 |
Two computers C1 and C2 are configured as follows C1 has IP address 203 197 2 53 and netmask 255 255 128 0 C2 has IP address 203 197 75 201 and netmask 255 255 192 0 Which one of the following statements is true C1 and C2 both assume they are on the same network C2 assumes C1 is on same network but C1 assumes C2 is on a different network C1 assumes C2 is on same network but C2 assumes C1 is on a different network C1 and C2 both assume they are on different networks | Subnetting | 179 |
The subnet mask for a particular network is 255 255 31 0 Which of the following pairs of ext IP addresses could belong to this network 172 57 88 62 and 172 56 87 23 10 35 28 2 and 10 35 29 4 191 203 31 87 and 191 234 31 88 128 8 129 43 and 128 8 161 55 | Subnetting | 179 |
The routing table of a router is shown below Destination Subnet Mask Interface 128 75 43 0 255 255 255 0 Eth0 128 75 43 0 255 255 255 128 Eth1 192 12 17 5 255 255 255 255 Eth3 Default Eth2 On which interface will the router forward packets addressed to destinations 128 75 43 16 and 192 12 17 10 respectively Eth1 and Eth2 Eth0 and Eth2 Eth0 and Eth3 Eth1 and Eth3 | Subnetting | 179 |
The address of a class B host is to be split into subnets with a 6 bit subnet number What is the maximum number of subnets and the maximum number of hosts in each subnet 62 subnets and 262142 hosts 64 subnets and 262142 hosts 62 subnets and 1022 hosts 64 subnets and 1024 hosts | Subnetting | 179 |
Suppose computers A and B have IP addresses 10 105 1 113 and 10 105 1 91 respectively and they both use same netmask N Which of the values of N given below should not be used if A and B should belong to the same network 255 255 255 0 255 255 255 128 255 255 255 192 255 255 255 224 | Subnetting | 179 |
In the network 200 10 11 144 27 the fourth octet in decimal of the last IP address of the network which can be assigned to a host is _____ | Subnetting | 179 |
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 1022 1023 2046 2047 | Subnetting | 179 |
Host X has IP address 192 168 1 97 and is connected through two routers R1 and R2 to an u00adother host Y with IP address 192 168 1 80 Router R1 has IP addresses 192 168 1 135 and 192 168 1 110 R2 has IP addresses 192 168 1 67 and 192 168 1 155 The netmask used in the network is 255 255 255 224 Which IP address should X configure its gateway as 192 168 1 67 192 168 1 110 192 168 1 135 192 168 1 155 | Subnetting | 179 |
Host X has IP address 192 168 1 97 and is connected through two routers R1 and R2 to an u00adother host Y with IP address 192 168 1 80 Router R1 has IP addresses 192 168 1 135 and 192 168 1 110 R2 has IP addresses 192 168 1 67 and 192 168 1 155 The netmask used in the network is 255 255 255 224 Given the information above how many distinct subnets are guaranteed to already exist in the network 1 2 3 6 | Subnetting | 179 |
Consider the following routing table at an IP router Network No Net Mask Next Hop 128 96 170 0 255 255 254 0 Interface 0 128 96 168 0 255 255 254 0 Interface 1 128 96 166 0 255 255 254 0 R2 128 96 164 0 255 255 252 0 R3 0 0 0 0 Default R4 For each IP address in Group I Identify the correct choice of the next hop from Group II using the entries from the routing table above Group I Group II i 128 96 171 92 a Interface 0 ii 128 96 167 151 b Interface 1 iii 128 96 163 151 c R2 iv 128 96 164 121 d R3 e R4 i a ii c iii e iv d i a ii d iii b iv e i b ii c iii d iv e i b ii c iii e iv d | Subnetting | 179 |
An organization has a class B network and wishes to form subnets for 64 departments The subnet mask would be 255 255 0 0 255 255 64 0 255 255 128 0 255 255 252 0 | Subnetting | 179 |
An Internet Service Provider ISP has the following chunk of CIDR based IP addresses available with it 245 248 128 0 20 The ISP wants to give half of this chunk of addresses to Organization A and a quarter to Organization B while retaining the remaining with itself Which of the following is a valid allocation of addresses to A and B A 245 248 136 0 21 ext and 245 248 128 0 22 B 245 248 128 0 21 ext and u00a0245 248 128 0 22 C 245 248 132 0 22 ext and u00a0245 248 132 0 21 D 245 248 136 0 24 ext and u00a0245 248 132 0 21 | Subnetting | 179 |
A subnetted Class B network has the following broadcase address 144 16 95 255 Its subnet mask is necessarily 255 255 224 0 is necessarily 255 255 240 0 is necessarily 255 255 248 0 could be any one of 255 255 224 0 255 255 240 0 255 255 248 0 | Subnetting | 179 |
A subnet has been assigned a subnet mask of 255 255 255 192 What is the maximum number of hosts that can belong to this subnet 14 30 62 126 | Subnetting | 179 |
A company has a class C network address of 204 204 204 0 It wishes to have three subnets one with 100 hosts and two with 50 hosts each Which one of the following options represents a feasible set of subnet address subnet mask pairs 204 204 204 128 255 255 255 192 204 204 204 0 255 255 255 128 204 204 204 64 255 255 255 128 204 204 204 0 255 255 255 192 204 204 204 192 255 255 255 128 204 204 204 64 255 255 255 128 204 204 204 128 255 255 255 128 204 204 204 192 255 255 255 192 204 204 204 224 255 255 255 192 204 204 204 128 255 255 255 128 204 204 204 64 255 255 255 192 204 204 204 0 255 255 255 192 | Subnetting | 179 |
Use the patterns given to prove that sum limits_ i 0 n 1 2i 1 n 2 You are not permitted to employ induction Use the result obtained in a to prove that sum limits_ i 1 n i frac n n 1 2 | Summation | 180 |
Let P sum_ substack 1 le i le 2k i odd i and Q sum_ substack 1 le i le 2k i even i where k is a positive integer Then P Q k P Q k P Q P Q 2k | Summation | 180 |
sum limits_ x 1 99 frac 1 x x 1 __________________ | Summation | 180 |
Choose the correct alternatives more than one may be correct and write the corresponding letters only Advantage of synchronous sequential circuits over asynchronous ones is faster operation ease of avoiding problems due to hazards lower hardware requirement better noise immunity none of the above | Synchronous Asynchronous Circuits | 181 |
Consider the circuit given below with initial state Q_0 1 Q_1 Q_2 0 The state of the circuit is given by the value 4Q_2 2Q_1 Q_0 Which one of the following is correct state sequence of the circuit 1 3 4 6 7 5 2 1 2 5 3 7 6 4 1 2 7 3 5 6 4 1 6 5 7 2 3 4 | Synchronous Circuit | 182 |
Design a synchronous counter to go through the following states 1 4 2 3 1 4 2 3 1 4 dots | Synchronous Counter | 183 |
System calls are usually invoked by using a software interrupt polling an indirect jump a privileged instruction | System Calls | 184 |
What values of x y and z satisfy the following system of linear equations begin bmatrix 1 amp 2 amp 3 1 amp 3 amp 4 2 amp 2 amp 3 end bmatrix begin bmatrix x y z end bmatrix begin bmatrix 6 8 12 end bmatrix x 6 y 3 z 2 x 12 y 3 z 4 x 6 y 6 z 4 x 12 y 3 z 0 | System Of Equations | 185 |
The following system of equations x_1 x_2 2x_3 1 x_1 2x_2 3x_3 2 x_1 4x_2 u03b1x_3 4 has a unique solution The only possible value s for u03b1 is are 0 either 0 or 1 one of 0 1 or 1 any real number | System Of Equations | 185 |
Let c_ 1 c_ n be scalars not all zero such that sum_ i 1 n c_ i a_ i 0 where a_ i are column vectors in R n Consider the set of linear equations Ax b where A left a_ 1 a_ n right and b sum_ i 1 n a_ i The set of equations has a unique solution at x J_ n where J_ n denotes a n dimensional vector of all 1 no solution infinitely many solutions finitely many solutions | System Of Equations | 185 |
If the following system has non trivial solution u00a0 px qy rz 0 qx ry pz 0 rx py qz 0 then which one of the following options is TRUE u00a0 p q r 0 ext or p q r p q r 0 ext or p q r p q r 0 ext or p q r p q r 0 ext or p q r | System Of Equations | 185 |
How many solutions does the following system of linear equations have x 5y 1 x y 2 x 3y 3 infinitely many two distinct solutions unique none | System Of Equations | 185 |
Consider the system each consisting of m linear equations in n variables If m lt n then all such systems have a solution If m gt n then none of these systems has a solution If m n then there exists a system which has a solution Which one of the following is CORRECT I II and III are true Only II and III are true Only III is true None of them is true | System Of Equations | 185 |
Consider the following system of linear equations left begin array ccc 2 amp 1 amp 4 4 amp 3 amp 12 1 amp 2 amp 8 end array right left begin array ccc x y z end array right left begin array ccc alpha 5 7 end array right Notice that the second and the third columns of the coefficient matrix are linearly dependent For how many values of alpha does this system of equations have infinitely many solutions 0 1 2 3 | System Of Equations | 185 |
Consider the following system of linear equations 2x_1 x_2 3x_3 1 3x_1 2x_2 5x_3 2 x_1 4x_2 x_3 3 The system of equations has no solution a unique solution more than one but a finite number of solutions an infinite number of solutions | System Of Equations | 185 |
Consider the following system of equations 3x 2y 1 4x 7z 1 x y z 3 x 2y 7z 0 The number of solutions for this system is ______________ | System Of Equations | 185 |
Let Ax b be a system of linear equations where A is an m imes n matrix and b is a m imes 1 column vector and X is an n imes1 column vector of unknowns Which of the following is false The system has a solution if and only if both A and the augmented matrix Ab have the same rank If m lt n and b is the zero vector then the system has infinitely many solutions If m n and b is a non zero vector then the system has a unique solution The system will have only a trivial solution when m n b is the zero vector and ext rank A n | System Of Equations | 185 |
Consider the following set of equations x 2y 5 4x 8y 12 3x 6y 3z 15 This set has unique solution has no solution has finite number of solutions has infinite number of solutions | System Of Equations | 185 |
The three way handshake for TCP connection establishment is shown below Which of the following statements are TRUE S1 Loss of SYN ACK from the server will not establish a connection S2 Loss of ACK from the client cannot establish the connection S3 The server moves LISTEN u2192 SYN_RCVD u2192 SYN_SENT u2192 ESTABLISHED in the state machine on no packet loss S4 The server moves LISTEN u2192 SYN_RCVD u2192 ESTABLISHED in the state machine on no packet loss S 2 and S 3 only S 1 and S 4 only S 1 and S 3 only S 2 and S 4 only | Tcp | 186 |
In TCP a unique sequence number is assigned to each byte word segment message | Tcp | 186 |
Identify the correct sequence in which the following packets are transmitted on the network by a host when a browser requests a webpage from a remote server assuming that the host has just been restarted HTTP GET request DNS query TCP SYN DNS query HTTP GET request TCP SYN DNS query TCP SYN HTTP GET request TCP SYN DNS query HTTP GET request | Tcp | 186 |
Consider the following statements about the timeout value used in TCP The timeout value is set to the RTT Round Trip Time measured during TCP connection establishment for the entire duration of the connection Appropriate RTT estimation algorithm is used to set the timeout value of a TCP connection Timeout value is set to twice the propagation delay from the sender to the receiver Which of the following choices hold i is false but ii and iii are true i and iii are false but ii is title i and ii are false but iii is true i ii and iii are false | Tcp | 186 |
Consider a TCP connection in a state where there are no outstanding ACK s The sender sends two segments back to back The sequence numbers of the first and second segments are 230 and 290 respectively The first segment was lost but the second segment was received correctly by the receiver Let X be the amount of data carried in the first segment in bytes and Y be the ACK number sent by the receiver The values of X and Y in that order are 60 and 290 230 and 291 60 and 231 60 and 230 | Tcp | 186 |
Consider a TCP client and a TCP server running on two different machines After completing data transfer the TCP client calls close to terminate the connection and a FIN segment is sent to the TCP server Server side TCP responds by sending an ACK which is received by the client side TCP As per the TCP connection state diagram RFC 793 in which state does the client side TCP connection wait for the FIN from the server side TCP LAST ACK TIME WAIT FIN WAIT 1 FIN WAIT 2 | Tcp | 186 |
Assume that the bandwidth for a TCP connection is 1048560 bits sec Let alpha be the value of RTT in milliseconds rounded off to the nearest integer after which the TCP window scale option is needed Let beta be the maximum possible window size with window scale option Then the values of alpha and beta are 63 milliseconds 65535 imes 2 14 63 milliseconds 65535 imes 2 16 500 milliseconds 65535 imes 2 14 500 milliseconds 65535 imes 2 16 | Tcp | 186 |
Suppose two hosts use a TCP connection to transfer a large file Which of the following statements is are FALSE with respect to the TCP connection If the sequence number of a segment is m then the sequence number of the subsequent segment is always m 1 If the estimated round trip time at any given point of time is t sec the value of the retransmission timeout is always set to greater than or equal to t sec The size of the advertised window never changes during the course of the TCP connection The number of unacknowledged bytes at the sender is always less than or equal to the advertised window III only I and III only I and IV only II and IV only | Tcp | 186 |
Consider the following statements TCP connections are full duplex TCP has no option for selective acknowledgement TCP connections are message streams Only I is correct Only I and III are correct Only II and III are correct All of I II and III are correct | Tcp | 186 |
After Rajendra Chola returned from his voyage to Indonesia he ________ to visit the temple in Thanjavur was wishing is wishing wished had wished | Tenses | 187 |
Threads of a process share global variables but not heap heap but not global variables neither global variables nor heap both heap and global variables | Threads | 188 |
Consider the following statements with respect to user level threads and kernel supported threads context switch is faster with kernel supported threads for user level threads a system call can block the entire process Kernel supported threads can be scheduled independently User level threads are transparent to the kernel Which of the above statements are true II III and IV only II and III only I and III only I and II only | Threads | 188 |
Consider the following statements about user level threads and kernel level threads Which one of the following statements is FALSE Context switch time is longer for kernel level threads than for user level threads User level threads do not need any hardware support Related kernel level threads can be scheduled on different processors in a multi processor system Blocking one kernel level thread blocks all related threads | Threads | 188 |
A thread is usually defined as a light weight process because an Operating System OS maintains smaller data structure for a thread than for a process In relation to this which of the following statement is correct OS maintains only scheduling and accounting information for each thread OS maintains only CPU registers for each thread OS does not maintain virtual memory state for each thread OS does not maintain a separate stack for each thread | Threads | 188 |
In a database system unique timestamps are assigned to each transaction using Lamport s logical clock Let TS T_ 1 and TS T_ 2 be the timestamps of transactions T_ 1 and T_ 2 respectively Besides T_ 1 holds a lock on the resource R and T_ 2 has requested a conflicting lock on the same resource R The following algorithm is used to prevent deadlocks in the database system assuming that a killed transaction is restarted with the same timestamp if TS T_ 2 lt TS T_ 1 then T_ 1 is killed else T_ 2 waits Assume any transaction that is not killed terminates eventually Which of the following is TRUE about the database system that uses the above algorithm to prevent deadlocks The database system is both deadlock free and starvation free The database system is deadlock free but not starvation free The database system is starvation free but not deadlock free The database system is neither deadlock free nor starvation free | Timestamp Ordering | 189 |
For a host machine that uses the token bucket algorithm for congestion control the token bucket has a capacity of 1 mega byte and the maximum output rate is 20 mega bytes per second Tokens arrive at a rate to sustain output at a rate of 10 mega bytes per second The token bucket is currently full and the machine needs to send 12 mega bytes of data The minimum time required to transmit the data is _____________ seconds | Token Bucket | 190 |
A computer on a 10 Mbps network is regulated by a token bucket The token bucket is filled at a rate of 2 Mbps It is initially filled to capacity with 16 Megabits What is the maximum duration for which the computer can transmit at the full 10 Mbps 1 6 seconds 2 seconds 5 seconds 8 seconds | Token Bucket | 190 |
Which level of locking provides the highest degree of concurrency in a relational database Page Table Row Page table and row level locking allow the same degree of concurrency | Transaction And Concurrency | 191 |
In a data flow diagram the segment shown below is identified as having transaction flow characteristics with p2 identified as the transaction center A first level architectural design of this segment will result in a set of process modules with an associated invocation sequence The most appropriate architecture is p1 invokes p2 p2 invokes either p3 or p4 or p5 p2 invokes p1 and then invokes p3 or p4 or p5 A new module Tc is defined to control the transaction flow This module Tc first invokes pl and then invokes p2 p2 in turn invokes p3 or p4 or p5 A new module Tc is defined to control the transaction flow This module Tc invokes p2 p2 invokes p1 and then invokes p3 or p4 or p5 | Transactions | 192 |
For the schedule given below which of the following is correct 1 Read A 2 Read B 3 Write A 4 Read A 5 Write A 6 Write B 7 Read B 8 Write B This schedule is serializable and can occur in a scheme using 2PL protocol This schedule is serializable but cannot occur in a scheme using 2PL protocol This schedule is not serializable but can occur in a scheme using 2PL protocol This schedule is not serializable and cannot occur in a scheme using 2PL protocol | Transactions | 192 |
Consider two transactions T_1 and T_2 and four schedules S_1 S_2 S_3 S_4 of T_1 and T_2 as given below T_1 R_1 x W_1 x W_1 y T_2 R_2 x R_2 y W_2 y S_1 R_1 x R_2 x R_2 y W_1 x W_1 y W_2 y S_2 R_1 x R_2 x R_2 y W_1 x W_2 y W_1 y S_3 R_1 x W_1 x R_2 x W_1 y R_2 y W_2 y S_4 R_2 x R_2 y R_1 x W_1 x W_1 y W_2 y Which of the above schedules are conflict serializable S_1 ext and S_2 S_2 ext and S_3 S_3 only S_4 only | Transactions | 192 |
Consider three data items D1 D2 and D3 and the following execution schedule of transactions T1 T2 and T3 In the diagram R D and W D denote the actions reading and writing the data item D respectively Which of the following statements is correct The schedule is serializable as T2 T3 T1 The schedule is serializable as T2 T1 T3 The schedule is serializable as T3 T2 T1 The schedule is not serializable | Transactions | 192 |
Consider the following two transactions T1 and T2 T1 read A T2 read B read B read A if A 0 then B u2190 B 1 if B u2260 0 then A u2190 A 1 write B write A Which of the following schemes using shared and exclusive locks satisfy the requirements for strict two phase locking for the above transactions S1 lock S A S2 lock S B read A read B lock S B lock S A read B read A if A 0 if B u2260 0 then B u2190 B 1 then A u2190 A 1 write B write A commit commit unlock A unlock B unlock B unlock A S1 lock X A S2 lock X B read A read B lock X B lock X A read B read A if A 0 if B u2260 0 then B u2190 B 1 then A u2190 A 1 write B write A unlock A unlock A commit commit unlock B unlock A S1 lock S A S2 lock S B read A read B lock X B lock X A read B read A if A 0 if B u2260 0 then B u2190 B 1 then A u2190 A 1 write B write A unlock A unlock B commit commit unlock B unlock A S1 lock S A S2 lock S B read A read B lock X B lock X A read B read A if A 0 if B u2260 0 then B u2190 B 1 then A u2190 A 1 write B write A unlock A unlock A unlock B unlock B commit commit | Transactions | 192 |
Consider the following three schedules of transactions T1 T2 and T3 Notation In the following NYO represents the action Y R for read W for write performed by transac u00adtion N on object O S1 2RA 2WA 3RC 2WB 3WA 3WC 1RA 1RB 1WA 1WB S2 3RC 2RA 2WA 2WB 3WA 1RA 1RB 1WA 1WB 3WC S3 2RZ 3RC 3WA 2WA 2WB 3WC 1RA 1RB 1WA 1WB Which of the following statements is TRUE S1 S2 and S3 are all conflict equivalent to each other No two of S1 S2 and S3 are conflict equivalent to each other S2 is conflict equivalent to S3 but not to S1 S1 is conflict equivalent to S2 but not to S3 | Transactions | 192 |
Consider the following schedules involving two transactions Which one of the following statements is TRUE S_1 r_1 X r_1 Y r_2 X r_2 Y w_2 Y w_1 X S_2 r_1 X r_2 X r_2 Y w_2 Y r_1 Y w_1 X Both S_1 and S_2 are conflict serializable S_1 is conflict serializable and S_2 is not conflict serializable S_1 is not conflict serializable and S_2 is conflict serializable Both S_1 and S_2 are not conflict serializable | Transactions | 192 |
Consider the following schedule S of transactions T1 and T2 T1 T2 Read A A A 10 Read A Temp 0 2 A Write A Read B Write A Read B B B 10 Write B B B Temp Write B Which of the following is TRUE about the schedule S S is serializable only as T1 T2 S is serializable only as T2 T1 S is serializable both as T1 T2 and T2 T1 S is serializable either as T1 or as T2 | Transactions | 192 |
Consider the following log sequence of two transactions on a bank account with initial balance 12000 that transfer 2000 to a mortgage payment and then apply a 5 interest T1 start T1 B old 1200 new 10000 T1 M old 0 new 2000 T1 commit T2 start T2 B old 10000 new 10500 T2 commit Suppose the database system crashes just before log record 7 is written When the system is restarted which one statement is true of the recovery procedure We must redo log record 6 to set B to 10500 We must undo log record 6 to set B to 10000 and then redo log records 2 and 3 We need not redo log records 2 and 3 because transaction T1 has committed We can apply redo and undo operations in arbitrary order because they are idempotent | Transactions | 192 |
Amongst the ACID properties of a transaction the Durability property requires that the changes made to the database by a successful transaction persist Except in case of an Operating System crash Except in case of a Disk crash Except in case of a power failure Always even if there is a failure of any kind | Transactions | 192 |
A company maintains records of sales made by its salespersons and pays them commission based on each individual s total sales made in a year This data is maintained in a table with following schema salesinfo salespersonid totalsales commission In a certain year due to better business results the company decides to further reward its salespersons by enhancing the commission paid to them as per the following formula If commission lt 50000 enhance it by 2 If 50000 lt commission lt 100000 enhance it by 4 If commission gt 100000 enhance it by 6 The IT staff has written three different SQL scripts to calculate enhancement for each slab each of these scripts is to run as a separate transaction as follows T1 Update salesinfo Set commission commission 1 02 Where commission lt 50000 T2 Update salesinfo Set commission commission 1 04 Where commission gt 50000 and commission is lt 100000 T3 Update salesinfo Set commission commission 1 06 Where commission gt 100000 Which of the following options of running these transactions will update the commission of all salespersons correctly Execute T1 followed by T2 followed by T3 Execute T2 followed by T3 T1 running concurrently throughout Execute T3 followed by T2 T1 running concurrently throughout Execute T3 followed by T2 followed by T1 | Transactions | 192 |
Which one of the following is NOT a part of the ACID properties of database transactions Atomicity Consistency Isolation Deadlock freedom | Transactions | 192 |
Which of the following scenarios may lead to an irrecoverable error in a database system A transaction writes a data item after it is read by an uncommitted transaction A transaction reads a data item after it is read by an uncommitted transaction A transaction reads a data item after it is written by a committed transaction A transaction reads a data item after it is written by an uncommitted transaction | Transactions | 192 |
Consider the following two phase locking protocol Suppose a transaction T accesses for read or write operations a certain set of objects O_1 O_k This is done in the following manner ext Step 1 T acquires exclusive locks to O_1 O_k in increasing order of their addresses ext Step 2 The required operations are performed ext Step 3 All locks are released This protocol will guarantee serializability and deadlock freedom guarantee neither serializability nor deadlock freedom guarantee serializability but not deadlock freedom guarantee deadlock freedom but not serializability | Transactions | 192 |
Fig 7 shows a B tree where only key values are indicated in the records Each block can hold upto three records A record with a key value 34 is inserted into the B tree Obtain the modified B tree after insertion | Tree | 193 |
The number of leaf nodes in a rooted tree of n nodes with each node having 0 or 3 children is frac n 2 frac n 1 3 frac n 1 2 frac 2n 1 3 | Trees | 194 |
Level order traversal of a rooted tree can be done by starting from the root and performing preorder traversal in order traversal depth first search breadth first search | Trees | 194 |
Let G V E be a graph Define xi G sum limits_d i_d d where i_d is the number of vertices of degree d in G If S and T are two different trees with xi S xi T then mid S mid 2 mid T mid mid S mid mid T mid 1 mid S mid mid T mid mid S mid mid T mid 1 | Trees | 194 |
In a complete k ary tree every internal node has exactly k children The number of leaves in such a tree with n internal node is nk n 1 k 1 n k 1 1 n k 1 | Trees | 194 |
Consider the pseudocode given below The function DoSomething takes as argument a pointer to the root of an arbitrary tree represented by the leftMostChild rightSibling representation Each node of the tree is of type treeNode ypedef struct treeNode treeptr struct treeNode treeptr leftMostChild rightSibling int DoSomething treeptr tree int value 0 if tree NULL if tree gt leftMostChild NULL value 1 else value DoSomething tree gt leftMostChild value value DoSomething tree gt rightSibling return value When the pointer to the root of a tree is passed as the argument to DoSomething the value returned by the function corresponds to the number of internal nodes in the tree height of the tree number of nodes without a right sibling in the tree number of leaf nodes in the tree | Trees | 194 |
Consider the following rooted tree with the vertex labeled P as the root The order in which the nodes are visited during an in order traversal of the tree is SQPTRWUV SQPTUWRV SQPTWUVR SQPTRUWV | Trees | 194 |
Consider the following 2 3 4 tree i e B tree with a minimum degree of two in which each data item is a letter The usual alphabetical ordering of letters is used in constructing the tree What is the result of inserting G in the above tree None of the above | Trees | 194 |
Consider all possible trees with n nodes Let k be the number of nodes with degree greater than 1 in a given tree What is the maximum possible value of k | Trees | 194 |
Choose the correct alternatives more than one may be correct and write the corresponding letters only A 2 3 tree is such that All internal nodes have either 2 or 3 children All paths from root to the leaves have the same length The number of internal nodes of a 2 3 tree having 9 leaves could be 4 5 6 7 | Trees | 194 |
A complete n ary tree is one in which every node has 0 or n sons If x is the number of internal nodes of a complete n ary tree the number of leaves in it is given by x n 1 1 xn 1 xn 1 x n 1 | Trees | 194 |
A complete n ary tree is a tree in which each node has n children or no children Let I be the number of internal nodes and L be the number of leaves in a complete n ary tree If L 41 and I 10 what is the value of n 3 4 5 6 | Trees | 194 |
A 3 ext ary tree is a tree in which every internal node has exactly three children Use induction to prove that the number of leaves in a 3 ext ary tree with n internal nodes is 2 n 1 | Trees | 194 |
Derive a recurrence relation for the size of the smallest AVL tree with height h What is the size of the smallest AVL tree with height 8 | Trees | 194 |
The aim of the following question is to prove that the language M M is the code of the Turing Machine which irrespective of the input halts and outputs a 1 is undecidable This is to be done by reducing from the language M x M halts on x which is known to be undecidable In parts a and b describe the 2 main steps in the construction of M In part c describe the key property which relates the behaviour of M on its input w to the behaviour of M on x On input w what is the first step that M must make On input w based on the outcome of the first step what is the second step M must make What key property relates the behaviour of M on w to the behaviour of M on x | Turing Machine | 195 |
Subsets and Splits