Q21. What will be the output of the following PHP line?
echoo "Pakistan", "is", "the", "best", "Country"
Q22. Which relationship is illustrated by a line that begins with an unfilled diamond?
Q23. What will be the output of the following PHP code?
if (!-0.0)
  print "Coding is the best" ;
else
  print "Courtesy Coding";
Q24. To prevent a method from being overridden by a subclass, which method scope is used in object oriented PHP?
Q25. XML is a markup language where documents must be marked up correctly.
Q26. Which statement will output $x on the screen?
Q27. Before you can start processing images with PHP, you must first add the ability to upload images to your administrative form on ________
Q28. Which class accepts a class name or an object reference and returns an array of interface name?
Q29. The open source software version of netscape is _________
Q30. State whether the given statement is true or false. !DOCTYPE is case sensitiveâ€.
Q31. The number of scalar additions and subtractions used in Strassen’s matrix multiplication algorithm is ________
Q32. Which of the following is an example of asymmetric encryption technique?
Q33. Consider a reference string 7,0,1,2,0,3,0,4,2,3,0,3,2,1,2,0,1,7,0,1 of frame size 3. Calculate the number of page faults using optimal page replacement algorithm.
Q34. What is the auxiliary space requirement of introsort?
Q35. What is the average time complexity of counting sort?
Q36. What is the time complexity of the following iterative implementation used to find the largest and smallest element in an array?
#include
int get_max_element(int *arr,int n){
int i, max_element = arr[0];
for(i = 1; i < n; i++)
if(arr[i] > max_element)
max_element = arr[i];
return max_element;
}
int get_min_element(int *arr, int n){
  int i, min_element = arr[0];
  for(i = 1; i < n; i++)
  if(arr[i] < min_element)
   min_element = arr[i];
  return min_element;
}
int main(){
int n = 7, arr[7] = {1,1,1,0,-1,-1,-1};
int max_element = get_max_element(arr,n);
int min_element = get_min_element(arr,n);
printf("%d %d",max_element,min_element);
return 0;
}
Q37. What is the pre-processing time of Rabin and Karp Algorithm?
Q38. Which of the following can be the base case for the recursive implementation used to find the length of linked list?
#include< stdio.h >
#include< stdlib.h >
struct Node{
int val;
struct Node *next;
}*head;
int get_len(){
struct Node *temp = head->next;
int len = 0;
while(temp != 0){
len++;
temp = temp->next;
}
return len;
}
int main(){
int arr[10] = {1,2,3,4,5}, n = 5, i;
struct Node *temp, *newNode;
head = (struct Node*)malloc(sizeof(struct Node));
head->next = 0;
int len = get_len();
printf("%d",len);
return 0;
}
Q39. What is the time complexity of the following dynamic programming implementation used to find the minimum number of jumps?
#include< stdio.h >
#include< limits.h >
int min_jumps(int *arr, int len){
int j, idx, jumps[len];
jumps[len - 1] = 0;
for(idx = len - 2; idx >= 0; idx--)
{
int tmp_min = INT_MAX;
for(j = 1; j <= arr[idx] && idx + j < len; j++)
{
if(jumps[idx + j] + 1 < tmp_min)
tmp_min = jumps[idx + j] + 1;
}
jumps[idx] = tmp_min;
}
return jumps[0];
}
int main(){
int arr[] ={1, 1, 1, 1, 1, 1, 1, 1, 1},len = 9;
int ans = min_jumps(arr, len);
printf("%d\n",ans);
return 0;
}
Q40. What is the time complexity of the following dynamic programming implementation of the boolean parenthesization problem?
int count_bool_parenthesization(char *sym, char *op){
  int str_len = strlen(sym);
  int True[str_len][str_len],False[str_len][str_len];
  int row,col,length,l;
  for(row = 0, col = 0; row < str_len; row++,col++)
{
   if(sym[row] == 'T')
   {
    True[row][col] = 1;
    False[row][col] = 0;
   }
   else
   {
    True[row][col] = 0;
    False[row][col] = 1;
}
}
for(length = 1; length < str_len; length++)
{
for(row = 0, col = length; col < str_len; col++, row++)
{
True[row][col] = 0;
False[row][col] = 0;
for(l = 0; l < length; l++)
{
int pos = row + l;
int t_row_pos = True[row][pos] + False[row][pos];
int t_pos_col = True[pos+1][col] + False[pos+1][col];
if(op[pos] == '|')
{
False[row][col] += False[row][pos] * False[pos+1][col];
True[row][col] += t_row_pos * t_pos_col - False[row][pos] * False[pos+1][col];;
}
if(op[pos] == '&')
{
True[row][col] += True[row][pos] * True[pos+1][col];
False[row][col] += t_row_pos * t_pos_col - True[row][pos] * True[pos+1][col];
}
if(op[pos] == '^')
{
True[row][col] += True[row][pos] * False[pos+1][col] + False[row][pos] * True[pos + 1][col];
False[row][col] += True[row][pos] * True[pos+1][col] + False[row][pos] * False[pos+1][col];
}
}
}
}
  return True[0][str_len-1];
}