Vous êtes sur la page 1sur 136

6/24/2019 Six Phrase - mySlate

TCS NINJA BASIC MCQs


Test Summary
No. of Sections: 1
No. of Questions: 357
Total Duration: 10 min

Section 1 - Basic Programming Logic

Section Summary
No. of Questions: 357
Duration: 10 min

Additional Instructions:
None

Q1. Neelam wants to share her code with a colleague, who may modify it. Thus she wants to include the date of the program creation,
the author and other information with the program. What component should she use?

A.Header les

B.Iteration

C.Comments

D.Preprocessor directive

Q2. What is the output of the following code statements? The compiler saves the rst integer at the memory location 4165 and the rest
at consecutive memory spaces in order of declaration. Integer is one byte long.

A.30

B.4165

C.40

D.4166

Q3. A data type is stored as an 6 bit signed integer. Which of the following cannot be represented by this data type?

A. -12

B. 0

C.32

D.18

https://admin.myslate.sixphrase.com/test/preview?test_id=1444a088-f636-4422-8f78-3da9616763a5&branch_id=331ab009-cfbf-44c0-b68b-8d6bc1103e93&isprint=true 1/136
6/24/2019 Six Phrase - mySlate

E.64

Q4. A language has 28 different letters in total. Each word in the language iscomposed of maximum 7 letters. You want to create a
data-type to store a word ofthis language. You decide to store the word as an array of letters. How many bits will you assign to the
data-type to be able to store all kinds of words of the language.

a.7

b.35

c.28

d.196

Q5. A 10-bit unsigned integer has the following range:

a.0 to 1000

b.0 to 1024

c.1 to 1025

d.0 to 1023

Q6. Parul takes as input two numbers: a and b. a and b can take integer values between 0 and 255. She stores a, b and c as 1-byte data
type. She writes the following code statement to process a and b and put the result in c. c = a + 2*b To her surprise her program
gives the right output with some input values of a and b, while gives an erroneous answer for others. For which of the following
inputs will it give a wrong answer?

a. a = 10 b = 200

b. a = 200 b = 10

c. a = 50 b = 100

d. a = 100 b = 50

Q7. Which is used to convert source code to target language

a. linker

b. compiler

c. executer

https://admin.myslate.sixphrase.com/test/preview?test_id=1444a088-f636-4422-8f78-3da9616763a5&branch_id=331ab009-cfbf-44c0-b68b-8d6bc1103e93&isprint=true 2/136
6/24/2019 Six Phrase - mySlate

d. loader

Q8. Tricha wants to store a list of binary data.Which of following data types should she use?

a. Integer

b. Float

c. Character

d. Boolean

Q9. Which of the following options is an exception to being a part of composite data types?

a. Union

b. Array

c. Structure

d. Stack

Q10. The datatype is store as 6 but unsigned integer. Which of the following can’t be represented by the this datatype:

a. -12

b. 0

c. 32

d. 18

Q11. Choose the correct answer Saumya writes a code which has a function which calls itself. Which programming concept is Saumya
using?

a. This is bad programming practice and should not be done.

b. Recursion

c. Decision Making

d. Overloading

Q12. Consider the following function function calculate( n ) { if(n equals 5) return 5 else return (n + calculate(n-5)) end } Shishir calls the
function by the statement, calculate(20). What value will the function return?
https://admin.myslate.sixphrase.com/test/preview?test_id=1444a088-f636-4422-8f78-3da9616763a5&branch_id=331ab009-cfbf-44c0-b68b-8d6bc1103e93&isprint=true 3/136
6/24/2019 Six Phrase - mySlate

a. 50

b. 200

c. 35

d. 20

Q13. Choose the correct answer function g(int n) { if (n > 0) return 1; else return -1; } function f(int a, int b) { if (a > b) return g(b-a); if (a <
b) return g(a-b); return 0; } If f(a,b) is called, what is returned?

a. Always -1

b. 1 if a > b, -1 if a < b, 0 otherwise

c. -1 if a > b, 1 if a < b, 0 otherwise

d. 0 if a equals b, -1 otherwise

Q14. Choose the correct answer Afzal writes a piece of code, where a set of three lines occur around 10 times in different parts of the
program. What programming concept can he use to shorten his program code length?

a. Use for loops

b. Use functions

c. Use arrays

d. Use classes

Q15. Talika wants to implement heterogeneous linked list for her project. Which of the following will help her do the same.

a. Void pointer

b. Null pointer

c. Wild pointer

d. Heterogeneous list follows the same procedure as the homogeneous list.


Hence no different pointer is required.

Q16. . What is the difference between a function and a method?

a. Function is a named code unlike method which is a part of an object

https://admin.myslate.sixphrase.com/test/preview?test_id=1444a088-f636-4422-8f78-3da9616763a5&branch_id=331ab009-cfbf-44c0-b68b-8d6bc1103e93&isprint=true 4/136
6/24/2019 Six Phrase - mySlate

b. Function contained in an object is called a method

c. Function cannot change variables outside its scope unlike method

d. There is no difference between the two

Q17. Consider the following code:


function modify(a,b)
{
Integer c,d=2
c= a*d+ b
return c
}
function calculate()
{
integer a = 5, b = 20, c
integer d= 10
c = modify(a, b);
c = c+ d
print c
}

a. 80

b. 40

c. 32

d. 72

Q18. What is the term given to the variable whose scope is beyond all the scopes i.e., it can be accessed by all the scopes?

a. Universal Variable

b. Global Variable

c. External Variable

d. Auto Variable

Q19. Anu wants to make a function that is not bound to any identi er.which of the following functions should she incorporate in her
program?

a. Anonymous Function

b. Friend Function

c. Null Function

d. Global Function

https://admin.myslate.sixphrase.com/test/preview?test_id=1444a088-f636-4422-8f78-3da9616763a5&branch_id=331ab009-cfbf-44c0-b68b-8d6bc1103e93&isprint=true 5/136
6/24/2019 Six Phrase - mySlate

Q20. Which of the following accessibility modes can be the speci er of a top level class’?Top-level classes can only have public,
abstract, and nal modi ers, and it is also possible to not de ne any class modi ers at all. This is called default/package
accessibility. Besides that, private, protected, and static modi ers cannot be used when declaring top-level classes. Private,
Protected, Public, No Modi er

a. Only Private

b. Protected and Private

c. Public and No Modi er

d. Only No Modi er

Q21. Top-level classes can only have public, abstract, and nal modi ers, and it is also possible to not de ne any class modi ers at all.
This is called default/package accessibility. Besides that, private, protected, and static modi ers cannot be used when declaring
top-level classes.
Question 6 WRONG
Which of the following accessibility modes can be the specifier of a top level class’?Top-level classes can only have public,
abstract, and nal modi ers, and it is also possible to not de ne any class modi ers at all. This is called default/package
accessibility. Besides that, private, protected, and static modi ers cannot be used when declaring top-level classes. Private,
Protected, Public, No Modi er

a. Only Private

b. Protected and Private

c. Public and No Modi er

d. Only No Modi er

Q22. Top-level classes can only have public, abstract, and nal modi ers, and it is also possible to not de ne any class modi ers at all.
This is called default/package accessibility. Besides that, private, protected, and static modi ers cannot be used when declaring
top-level classes.
Question 7 WRONG
Choose the correct answer. A pseudo-code which is similar to that of C++ and self-explanatory An accessible member function or
data member for an object are accessed by the statement objectname.functionname or objectname. data member name
respectively. class brush { Private: integer size, colorcode function getdata( ) {–}//Statement 1 public: integer name // Statement 2
function putdata(){…} } function main { brush b1, b2 print bl.name //Statement 3 b2.getdata() //Statement 4 } Deleting which line
will correct the error in the code?

a.Statement 1

b.Statement 2

c.Statement 3

d.Statement 4

Q23. Function MyDisplay(string MyStr) //statement 1 { print “Hello !” print MyStr return 1 // statement 2 } function main() //statement 3 {
string str= “Mickey” MyDisplay(str) // statement 4 } Which statement will generate an error.

a.Statement 1

https://admin.myslate.sixphrase.com/test/preview?test_id=1444a088-f636-4422-8f78-3da9616763a5&branch_id=331ab009-cfbf-44c0-b68b-8d6bc1103e93&isprint=true 6/136
6/24/2019 Six Phrase - mySlate

b.Statement 2

c.Statement 3

d.Statement 4

Q24. Choose the correct answer Tanuj writes the code for a function that takes as input n and calculates the sum of rst n natural
numbers. Function sum( n ) { if(??) return 1 else return (n + sum(n-1)) end } Fill in ?? in the code.

a. n equals 1

b. n equals 2

c. n >= 1

d. n > 1

Q25. Choose the correct answer Shrishti writes the code for a function that computes the factorial of the inputted number n. function
factorial(n) { if(n equals 1) return 1 else — MISSING STATEMENT — end } Fill in the missing statement.

a.return factorial(n-1)

b.return n*factorial(n)

c.return n*(n-1)

d.return n*factorial(n-1)

Q26. . The value of EOF is_____

a) -1

b) 0

c) 1

d) 10

Q27. Which of the following true about FILE *fp

a) FILE is a keyword in C for representing les and fp is a variable of FILE


type.

b) FILE is a structure and fp is a pointer to the structure of FILE type

https://admin.myslate.sixphrase.com/test/preview?test_id=1444a088-f636-4422-8f78-3da9616763a5&branch_id=331ab009-cfbf-44c0-b68b-8d6bc1103e93&isprint=true 7/136
6/24/2019 Six Phrase - mySlate

c) FILE is a stream

d) FILE is a buffered stream

Q28. The rst and second arguments of fopen are ______

a) A character string containing the name of the le & the second argument is
the mode

b) A character string containing the name of the user & the second argument
is the mode

c) A character string containing le poniter & the second argument is the


mode

d) None of the mentioned

Q29. If there is any error while opening a le, fopen will return

a) Nothing

b) EOF

c) NULL

d) Depends on compiler

Q30. fseek() should be preferred over rewind() mainly because

a) rewind() doesn’t work for empty les

b) rewind() may fail for large les

c) In rewind, there is no way to check if the operations completed


successfully

d) All of the above

Q31. . FILE is of type ______

a) int type

b) char * type

c) struct type

https://admin.myslate.sixphrase.com/test/preview?test_id=1444a088-f636-4422-8f78-3da9616763a5&branch_id=331ab009-cfbf-44c0-b68b-8d6bc1103e93&isprint=true 8/136
6/24/2019 Six Phrase - mySlate

d) None of the mentioned

Q32. FILE reserved word is

a) A structure tag declared in stdio.h

b) One of the basic datatypes in c

c) Pointer to the structure de ned in stdio.h

d) It is a type name de ned in stdio.h

Q33. getc() returns EOF when

a) End of les is reached

b) When getc() fails to read a character

c) Both of the above —

d) None of the above

Q34. Which of the following functions from “stdio.h” can be used in place of printf()?

a) fputs() with FILE stream as stdout.

b) fprintf() with FILE stream as stdout.

c) fwrite() with FILE stream as stdout.

d) All of the above three – a, b and c.

e) In “stdio.h”, there’s no other equivalent function of printf()

Q35. fputs adds newline character

a) True

b) False

c) Depends on the standard

d) Unde ned behaviour

https://admin.myslate.sixphrase.com/test/preview?test_id=1444a088-f636-4422-8f78-3da9616763a5&branch_id=331ab009-cfbf-44c0-b68b-8d6bc1103e93&isprint=true 9/136
6/24/2019 Six Phrase - mySlate
Q36. puts function adds newline character

a) True

b) False

c) Depends on the standard

d) Unde ned behaviour

Q37. An array is also known as ___________

a) Subscripted variable

b) Collective array

c) Ordinary variable

d) Similar Quantities variable

Q38. Till the array elements are not given any speci c value, they are supposed to contain all ____________

a) Zero

b) Garbage value

c) One

d) Combination of zero and one.

Q39. If an array is initialized where it is declared, then mentioning __________ of array is optional.

a) Data type

b) Dimension

c) name

d) Data type and Dimension

Q40. What happen if we assign a value to an array element whose subscript exceeds the size of array.

a) The program will give error

b) No output
https://admin.myslate.sixphrase.com/test/preview?test_id=1444a088-f636-4422-8f78-3da9616763a5&branch_id=331ab009-cfbf-44c0-b68b-8d6bc1103e93&isprint=true 10/136
6/24/2019 Six Phrase - mySlate

c) program will crash

d) none of these

Q41. What will be output of the following program


int main()
{
int b[4]={5,1,32,4};
int k,l,m;
k=++b[1];
l=b[1]++;
m=b[k++];
printf(“%d, %d, %d”,k,l,m);
return 0;
}

a) 2, 2, 4

b) 3, 2, 32

c) 3, 2, 4

d) 2, 3, 32

Q42. What will be output of the following program where c=65474 and int=2 bytes.
int main()
{
int c[3][4]={2,3,1,6,4,1,6,2,2,7,1,10};
printf(“%u, %u\n”, c+1, &c+1);
return 0;
}

a) 65482, 65498

b) 65476, 65476

c) 65476, 65498

d) No output

Q43. what will be output of the following program


int main()
{
int a[5],i=0;
while(i<5)
a[i]=++i;
for(i=0;i<5;i++)
printf(“%d,”,a[i]);}

a) garbage value,1,2,3,4

b) 1,2,3,4,5

https://admin.myslate.sixphrase.com/test/preview?test_id=1444a088-f636-4422-8f78-3da9616763a5&branch_id=331ab009-cfbf-44c0-b68b-8d6bc1103e93&isprint=true 11/136
6/24/2019 Six Phrase - mySlate

c) Error

d) Program crash

Q44. What will be output of the following program


int main()
{
oat a[]={12.4, 2.3, 4.5, 6.7};
printf(“%d bytes, %d bytes”, sizeof(a), sizeof(a[0]));
return 0;
}

a) 16 bytes, 4 bytes

b) 4 bytes, 4 bytes

c) 8 bytes, 4 bytes

d) None of these

Q45. Which one of this is equivalent to


int fun(int arr[])

a) int fun(arr)

b) int fun(int s[])

c) int fun(int arr[2])

d) None of these

Q46. In 2 Dimensional Array, it is necessary to mention _______ dimension.

a) second

b) rst

c) both

d) none of these

Q47. An array can be passed to a function by __________

a) Call by reference

b) call by value

c) Call by reference by passing base address to a function

https://admin.myslate.sixphrase.com/test/preview?test_id=1444a088-f636-4422-8f78-3da9616763a5&branch_id=331ab009-cfbf-44c0-b68b-8d6bc1103e93&isprint=true 12/136
6/24/2019 Six Phrase - mySlate

d) Both a and c

Q48. What will be output of the following program


int main()
{
int arr[4]={3,4,5,6};
int k[4];
k=arr;
printf(“%d\n”,k[1]);
}

a) Compile Time Error

b) 4

c) No output

d) Program crashes

Q49. Which of the following syntax is correct for command-line arguments?

a) int main(int var, char *argv[])

b) int main(char *arv[], int arg)

c) int main(char c,int v)

d) int main(int v,char c)

Q50. What does argv and argc indicate in int main(int argc, char *argv[]) ?

a) argument constant, argument variable

b) argument count, argument vector

c) argument constant, argument vector

d) argument count, argument variable

Q51. What type of array is generally generated in Command-line argument?

a) MultiDimensional Array

b) Jagged Array

c) 2-Dimensional Array

https://admin.myslate.sixphrase.com/test/preview?test_id=1444a088-f636-4422-8f78-3da9616763a5&branch_id=331ab009-cfbf-44c0-b68b-8d6bc1103e93&isprint=true 13/136
6/24/2019 Six Phrase - mySlate

d) Single Dimensional Array

Q52. The maximum length of the command-line arguments including the spaces is

a)May vary from one OS to another

b)256 characters

c)Depends on the Number of arguments

d)128 characters

Q53. The index of the last argument in command line arguments is

a) argc

b) argc * 2

c) argc – 1

d) argc + 1

Q54. What is the rst argument of command line ?

a)File Name

b)Program Designation

c)argument passed by user

d)Program Name

Q55. What argv means in command line argument?

a)Array of pointers

b)pointer to a character array

c)Array of character pointers

d)Array of Strings

Q56. What will be the output of the following program if argument passed to command lines are : prog 1 4 2
#include<stdio.h>
int main(int argc, char *argv[])
https://admin.myslate.sixphrase.com/test/preview?test_id=1444a088-f636-4422-8f78-3da9616763a5&branch_id=331ab009-cfbf-44c0-b68b-8d6bc1103e93&isprint=true 14/136
6/24/2019 { Six Phrase - mySlate

int j;
j = argv[1] + argv[2] – argv[3];
printf(“%d”, j);
return 0;
}

a)Error

b)3

c)Garbage Value

d)None of these

Q57. What argv[0] and argv[1] denote in Command line Arguments ?

a) Pointers to rst two command line argument supplied.

b) File Name and pointer to rst command line argument supplied.

c) Program Name and Pointer to the 1st argument.

d) None of these.

Q58. Which one of these is equivalent to argc ?

a) Number of Arguments

b) Number of Arguments – 1

c) Number of Arguments + 2

d) Number of Arguments + 1

Q59. What will be output of the following program if argument passed to command lines are : prog 1 4 2
#include<stdio.h>
int main(int argc, char *argv[])
{
while(argc–)
printf(“%s\n”,argv[argc]);
return 0;
}

a) 2 4 1

b) Garbage-value 2 4 1

c) Garbage-value 2 4 1 prog

https://admin.myslate.sixphrase.com/test/preview?test_id=1444a088-f636-4422-8f78-3da9616763a5&branch_id=331ab009-cfbf-44c0-b68b-8d6bc1103e93&isprint=true 15/136
6/24/2019 Six Phrase - mySlate

d) In nte Loop

Q60. What will be output of the following program if argument passed to command lines are : demo one two three
#include<stdio.h>
int main(int argc, char *argv[])
{
printf(“%c\n”,**+argv);
return 0;
}

a) n

b) o

c) t

d) Compile Time Error

Q61. What will be output of the following program if argument passed to command lines are : demo friday
#include<stdio.h>
int main(int argc, char *argv[])
{
printf(“%c”,*++argv[1]);
return 0;
}

a) r

b) f

c) i

d) d

Q62. What is the output of this C code?


#include 
void main()
{
m();
void m()
{
printf(“SimpleWay2Code”);
}
}

a) SimpleWay2Code

b) Compile time error

c) Nothing

d) Varies

Q63. What is the output of this C code?


https://admin.myslate.sixphrase.com/test/preview?test_id=1444a088-f636-4422-8f78-3da9616763a5&branch_id=331ab009-cfbf-44c0-b68b-8d6bc1103e93&isprint=true 16/136
6/24/2019 #include <stdio.h> Six Phrase - mySlate

void main()
{
static int x = 3;
x++;
if (x <= 5) { printf(“hello ”); main(); } }

a) Run time error

b) hello

c) In nite hello

d) hello hello

Q64. The value obtained in the function is given back to main by using ________ keyword?

a) return

b) static

c) new

d) volatile

Q65. What is the problem in the following declarations? int func(int); double func(int); int func( oat);

a) A function with same name cannot have different signatures

b) A function with same name cannot have different return types

c) A function with same name cannot have different number of parameters

d) All of the mentioned

Q66. What is the return-type of the function sqrt() 

a) int

b) oat

c) double

d) depends on the data type of the parameter

Q67. What is the output of this code having void return-type function? #include 
void foo()
{
return 1;
}
void main()
{
https://admin.myslate.sixphrase.com/test/preview?test_id=1444a088-f636-4422-8f78-3da9616763a5&branch_id=331ab009-cfbf-44c0-b68b-8d6bc1103e93&isprint=true 17/136
6/24/2019 int x = 0; Six Phrase - mySlate

x = foo();
printf(“%d”, x);
}

a) 1

b) 0

c) Runtime error

d) Compile time error

Q68. The output of the code below is


#include <stdio.h>
void main()
{
int k = m();
printf(“%d ”, k);
}
void m()
{
printf(“hello ”);
}

a) hello 5

b) Error

c) Nothing

d) Garbage value

Q69. The output of the code below is


#include 
int *m()
{
int *p = 5;
return p;
}
void main()
{
int *k = m();
printf(“%d”, k);
}

a) 5

b) Junk value

c) 0

d) Error

Q70. What will be the output of the program?


#include
int main()
https://admin.myslate.sixphrase.com/test/preview?test_id=1444a088-f636-4422-8f78-3da9616763a5&branch_id=331ab009-cfbf-44c0-b68b-8d6bc1103e93&isprint=true 18/136
6/24/2019 { Six Phrase - mySlate

int i=1;
if(!i)
printf(“SimpleWay2Code,”);
else
{
i=0;
printf(“C-Program”);
main();
}
return 0;
}

A. prints “SimpleWay2Code, C-Program” in nitely

B. prints “C-Program” in netly

C. prints “C-Program, SimpleWay2Code” in nitely

D. Error: main() should not inside else statement

Q71. How many times the program will print “SimpleWay2Code” ?


#include
int main()
{
printf(“SimpleWay2Code”);
main();
return 0;
}

A. In nite times

B. 32767 times

C. 65535 times

D. Till stack over ows

Q72. function main()


{
integer a=5,b=7
switch(a)
{
case 5 :print “I am 5”
break
case b:print “I am not 5”
break
default:print “I am different”
}
}

a.I am 5

b.I am not 5

c.I am different

d.Error

https://admin.myslate.sixphrase.com/test/preview?test_id=1444a088-f636-4422-8f78-3da9616763a5&branch_id=331ab009-cfbf-44c0-b68b-8d6bc1103e93&isprint=true 19/136
6/24/2019 Six Phrase - mySlate
Q73. Ashima wants to print a pattern which includes checking and changing a variables value iteratively She decides to use a
loop/condition Which of the following options should she use such that the body of the loop/condition is executed atleast once
whether the variable satis es the entering condition or not?

a.For Loop

b.While Loop

c.Do While Loop

d.Switch Case

Q74. The construct “if (condition) then A else B” is for which of the following purposes? 1) 2) 3) 4)

a.Decision-Making

b.Iteration

c.Recursion

d.Object Oriented Programming

Q75. Ravi and Rupali are asked to write a program to sum the rows of 2X2 matrices stored in the array A. Ravi writes the following code
(Code A): for n = 0 to 1 sumRow1[n] = A[n][1] + A[n][2] end Rupali writes the following code (Code B): sumRow1[0] = A[0][1] + A[0][2]
sumRow1[1] = A[1][1] + A[1][2] Comment upon these codes (Assume no loop unrolling done by compiler):

a.Code A will execute faster than Code B.

b.Code B will execute faster than Code A

c.Code A is logically incorrect.

d.Code B is logically incorrect.

Q76. Integer a =40, b =35, c=20, d =10 Comment about the output of the following two statements •
Print a*b/c-d
Print a*b/(c-d)
Comment about the output of the following two statements

a.Differ by 80

b.Same

c.Differ by 50

d.Differ by 160

Q77.
https://admin.myslate.sixphrase.com/test/preview?test_id=1444a088-f636-4422-8f78-3da9616763a5&branch_id=331ab009-cfbf-44c0-b68b-8d6bc1103e93&isprint=true 20/136
6/24/2019 Six Phrase - mySlate
Ashima wants to print a pattern which includes checking and changing a variables value iteratively She decides to use a
loop/condition Which of the following options should she use such that the body of the loop/condition is executed atleast once
whether the variable satis es the entering condition or not?

a.For Loop

b.While Loop

c.Do While Loop

d.Switch Case

Q78. What is the output of the following pseudo code? Int a =456,b,c,d=10; b=a/d; c=a-b; print c;

a.411.4

b.411

c.410.4

d.410

Q79. The construct “if (condition) then A else B” is for which of the following purposes?

a.Decision-Making

b.Iteration

c.Recursion

d.Object Oriented Programming

Q80. Function main() { Integer i=0.7 Static oat m=0.7 If(m equals i) Print(“We are equal”) Else If(m>i) Print(“I am greater”) Else Print(“I
am lesser”)

a.We are equal

b.I am greater

c.I am lesser

d.This code will generate an error

Q81. What is the output of this C code?


#include 
void main()
{
static int i;
printf(“i is %d”, i);
}
https://admin.myslate.sixphrase.com/test/preview?test_id=1444a088-f636-4422-8f78-3da9616763a5&branch_id=331ab009-cfbf-44c0-b68b-8d6bc1103e93&isprint=true 21/136
6/24/2019 Six Phrase - mySlate

a) 0

b) 1

c) Garbage Value

d) Run time error

Q82. What is the output of this C code?


#include 
int *i;
int main()
{
if (i == NULL)
printf(“true\n”);
return 0;
}

a) true

b) true only if NULL value is 0

c) Compile time error

d) Nothing

Q83. What is the output of this C code?


#include 
static int i;
void main()
{
int i;
printf(“i is %d”, i);
}

a) 0

b) Garbage Value

c) Run time error

d) Nothing

Q84. What is the output of this C code?


#include 
static int x = 5;
void main()
{
x = 9;
{
int x = 4;
}
printf(“%d”, x);
}
https://admin.myslate.sixphrase.com/test/preview?test_id=1444a088-f636-4422-8f78-3da9616763a5&branch_id=331ab009-cfbf-44c0-b68b-8d6bc1103e93&isprint=true 22/136
6/24/2019 Six Phrase - mySlate

a) 9

b) 4

c) 5

d) 0

Q85. The scope of an automatic variable is:

a) Within the block it appears

b) Within the blocks of the block it appears

c) Until the end of program

d) Within the block it appears & Within the blocks of the block it appears

Q86. Automatic variables are allocated space in the form of a:

a) stack

b) queue

c) priority queue

d) random

Q87. Which of the following is a storage speci er?

a) enum

b) union

c) auto

d) volatile

Q88. Automatic variables are stored in

a) stack

b) data segment
https://admin.myslate.sixphrase.com/test/preview?test_id=1444a088-f636-4422-8f78-3da9616763a5&branch_id=331ab009-cfbf-44c0-b68b-8d6bc1103e93&isprint=true 23/136
6/24/2019 Six Phrase - mySlate

c) register

d) heap

Q89. . What is the output of this C code?


#include 
int main()
{
register int i = 10;
int *q = &i;
*q = 11;
printf(“%d %d\n”, i, *q);
}

a) Depends on whether i is actually stored in machine register

b) 10 10

c) 11 11

d) Compile time error

Q90. Register storage class can be speci ed to global variables

a) true

b) false

c) Depends on the compiler

d) Depends on the standard

Q91. Register variables reside in

a) stack

b) registers

c) heap

d) main memory

Q92. Which of the following operation is not possible in a register variable?

a) Reading the value into a register variable

b) Copy the value from a memory variable

https://admin.myslate.sixphrase.com/test/preview?test_id=1444a088-f636-4422-8f78-3da9616763a5&branch_id=331ab009-cfbf-44c0-b68b-8d6bc1103e93&isprint=true 24/136
6/24/2019 Six Phrase - mySlate

c) Global declaration of register variable

d) All of the mentioned

Q93. The output of the code below is


#include 
int a;
void main()
{
if (a)
printf(“Hello”);
else
printf(“world”);
}

a) Hello

b) World

c) compile time error

d) none of the mentioned

Q94. The output of the code below is


#include 
void main()
{
int a = 5;
if (true);
printf(“hello”);
}

a) It will display hello

b) It will throw an error

c) No Output

d) Depends on Compiler

Q95. The output of the code below is


#include 
void main()
{
int a = 0;
if (a == 0)
printf(“hi”);
else
printf(“how are u”);
printf(“hello”);
}

a) hi

b) how are you

https://admin.myslate.sixphrase.com/test/preview?test_id=1444a088-f636-4422-8f78-3da9616763a5&branch_id=331ab009-cfbf-44c0-b68b-8d6bc1103e93&isprint=true 25/136
6/24/2019 Six Phrase - mySlate

c) hello

d) hihello

Q96. The following code ‘for(;;)’ represents an in nite loop. It can be terminated by.

a) break

b) exit(0)

c) abort()

d) all of the mentioned

Q97. The correct syntax for running two variable for loop simultaneously is.

a) for (i = 0; i < n; i++) for (j = 0; j < n; j += 5)

b) for (i = 0, j = 0;i < n, j < n; i++, j += 5)

c) for (i = 0; i < n;i++){}

d) for (j = 0; j < n;j += 5){}

Q98. Which for loop has range of similar indexes of ‘i’ used in for (i = 0;i < n; i++)?

a) for (i = n; i>0; i–)

b) for (i = n; i >= 0; i–)

c) for (i = n-1; i>0; i–)

d) for (i = n-1; i>-1; i–)

Q99. The output of this C code is?


#include 
void main()
{
int x = 0;
for (x < 3; x++) printf(“Hello”); }

a) Compile time error

b) Hello is printed thrice

c) Nothing

https://admin.myslate.sixphrase.com/test/preview?test_id=1444a088-f636-4422-8f78-3da9616763a5&branch_id=331ab009-cfbf-44c0-b68b-8d6bc1103e93&isprint=true 26/136
6/24/2019 Six Phrase - mySlate

d) Varies

Q100. The output of this C code is? #include 


void main()
{
double x = 0;
for (x = 0.0; x < 3.0; x++) printf(“Hello”); }

a) Run time error

b) Hello is printed thrice

c) Hello is printed twice

d) Hello is printed in nitely 

Q101. The output of this C code is? #include 


int main()
{
do
printf(“Inside while loop “);
while (0);
printf(“Outside loop\n”);
}

a) Inside while loop

b) Inside while loop


Outside loop

c) Outside loop

d) In nite loop

Q102. The output of this C code is?


#include 
int main()
{
int i = 0;
do {
i++;
printf(“Inside while loop\n”);
} while (i < 3);
 }

 a) Inside while loop Inside while loop Inside while loop

 b) Inside while loop Inside while loop

c) Depends on the compiler

d) Compile time error

https://admin.myslate.sixphrase.com/test/preview?test_id=1444a088-f636-4422-8f78-3da9616763a5&branch_id=331ab009-cfbf-44c0-b68b-8d6bc1103e93&isprint=true 27/136
6/24/2019 Six Phrase - mySlate
Q103. Which of the following cannot be used as LHS of the expression in for (exp1 ;exp2 ; exp3) ?
 

a) Variable

 b) Function

 c) typedef

 d) macros

Q104. Which keyword can be used for coming out of recursion?

a) break

b) return

c) exit

 d) Both break and return

Q105. The keyword ‘break’ cannot be simply used within:

a) do-while

 b) if-else

c) for

 d) while

Q106. Which keyword is used to come out of a loop only for single iteration?

 a) break

 b) continue

c) return

d) none of the mentioned 

Q107. The output of this C code is? #include 


void main()
{
int i = 0;
if (i == 0)
{
printf(“Hello”);
https://admin.myslate.sixphrase.com/test/preview?test_id=1444a088-f636-4422-8f78-3da9616763a5&branch_id=331ab009-cfbf-44c0-b68b-8d6bc1103e93&isprint=true 28/136
6/24/2019 break; Six Phrase - mySlate

}
}

a) Hello is printed in nite times

b) Hello

c) Varies

d) Compile time error

Q108. Which of the following is not valid variable name declaration?

a) int __v1;

b) int __1v;

c) int __V1;

d) None

Q109. Which of the following is not a valid variable name declaration?

a) int _v1;

b) int v_1;

c) int 1_v;

d) int _1v

Q110. Variable names beginning with underscore is not encouraged. Why?

a) It is not standard form

b) To avoid con icts since assemblers and loaders use such names

c) To avoid con icts since library routines use such names

d) To avoid con icts with environment variables of an operating system

Q111. Which is not a valid C variable name?

a) int number;

https://admin.myslate.sixphrase.com/test/preview?test_id=1444a088-f636-4422-8f78-3da9616763a5&branch_id=331ab009-cfbf-44c0-b68b-8d6bc1103e93&isprint=true 29/136
6/24/2019 Six Phrase - mySlate

b) oat rate;

c) int variable_count;

d) int $main;

Q112. What will be the output?


#include 
int main()
{
int main = 5;
printf(“%d”, main);
return 0;
}

a) compile-time error

b) run-time error

c) run without any error and prints 5

d) experience in nite looping

Q113. Which of the following cannot be a variable name in C?

a) friend

b) true

c) volatile

d) export

Q114. The format identi er ‘%i’ is also used for _____ data type?

a) char

b) double

c) oat

d) int

Q115. Which of the following is a User-de ned data type?

a) struct {char name[10], int age};


https://admin.myslate.sixphrase.com/test/preview?test_id=1444a088-f636-4422-8f78-3da9616763a5&branch_id=331ab009-cfbf-44c0-b68b-8d6bc1103e93&isprint=true 30/136
6/24/2019 Six Phrase - mySlate

b) typedef enum {Mon, Tue, Wed, Thu, Fri} Workdays;

c) typedef int Boolean;

d) all of the mentioned

Q116. What is short int in C programming?

a) Basic datatype of C

b) Quali er

c) short is the quali er and int is the basic datatype

d) All of the mentioned

Q117. What is the output of this C code?


#include 
int main()
{
signed char chr;
chr = 128;
printf(“%d\n”, chr);
return 0;
}

a) 128

b) -128

c) Depends on the compiler

d) None of the mentioned

Q118. What is the size of an int data type?

a) 4 Bytes

b) 8 Bytes

c) Depends on the system/compiler

d) Cannot be determined

Q119. Which of the datatypes have size that is variable?

a) int

https://admin.myslate.sixphrase.com/test/preview?test_id=1444a088-f636-4422-8f78-3da9616763a5&branch_id=331ab009-cfbf-44c0-b68b-8d6bc1103e93&isprint=true 31/136
6/24/2019 Six Phrase - mySlate

b) struct

c) oat

d) double

Q120. What is the output of this C code?


#include 
int main()
{
oat x = ‘a’;
printf(“%f”, x);
return 0;
}

a) 97.000000

b) run time error

c) a.0000000

d) a

Q121. What makes a class abstract?

a.By making all member functions constant.

b.By making at least one member function as pure virtual function.

c.By declaring it abstract using the static keyword.

d.By declaring it abstract using the virtual keyword.v

Q122. What makes a class abstract?

a.By making all member functions constant.

b.By making at least one member function as pure virtual function.

c.By declaring it abstract using the static keyword.

d.By declaring it abstract using the virtual keyword.

Q123. Which type of class allows only one object of it to be created?

a.Virtual class

b.Abstract class
https://admin.myslate.sixphrase.com/test/preview?test_id=1444a088-f636-4422-8f78-3da9616763a5&branch_id=331ab009-cfbf-44c0-b68b-8d6bc1103e93&isprint=true 32/136
6/24/2019 Six Phrase - mySlate

c.Singleton class

d.Friend class

Q124. Which of the following concepts of OOPS means exposing only necessary information to client?

a.Encapsulation

b.Abstraction

c.Data hiding

d.Data binding

Q125. Which type of inheritance needs a virtual function:

a.Multi level inheritance

b.Multiple inheritance

c.Hybrid inheritance

d.All of the above

Q126. Which of the following cannot be inherited?

a.Friend function

b.Static function

c.Destructor

Q127. Which of the following are available only in the class hierarchy chain?

a.Public data members

b.Private data members

c.Protected data members

d.Member functions

Q128. Which of the following is not a type of inheritance?

https://admin.myslate.sixphrase.com/test/preview?test_id=1444a088-f636-4422-8f78-3da9616763a5&branch_id=331ab009-cfbf-44c0-b68b-8d6bc1103e93&isprint=true 33/136
6/24/2019 Six Phrase - mySlate

a.Multiple

b.Multilevel

c.Distributive

d.Hierarchical

Q129. The process of building new classes from existing one is called ______.

a.Polymorphism

b.Structure

c.Inheritance

d.Cascading

Q130. Which of the following supports the concept of hierarchical classi cation?

a.Polymorphism

b.Encapsulation

c.Abstraction

d.Inheritance

Q131. Which Keyword from the following is used to inherit properties from one class into another?

a.extends

b.subclasses

c.native

d.all of the mentioned

Q132. Which one of the following connects the high-speed high-bandwidth device to memory subsystem and CPU.

a.expansion bus

b.PCI bus

https://admin.myslate.sixphrase.com/test/preview?test_id=1444a088-f636-4422-8f78-3da9616763a5&branch_id=331ab009-cfbf-44c0-b68b-8d6bc1103e93&isprint=true 34/136
6/24/2019 Six Phrase - mySlate

c.SCSI bus

d.none of the mentioned

Q133. The _________ present a uniform device-access interface to the I/O subsystem, much as system calls provide a standard interface
between the application and the operating system.

a.devices

b.buses

c.device drivers

d.I/O systems

Q134. .When device A has a cable that plugs into device B, and device B has a cable that plugs into device C and device C plugs into a
port on the computer, this arrangement is called a _________.

a.port

b.daisy chain

c.bus

d.cable

Q135. The _________ determines the cause of the interrupt, performs the necessary processing and executes a return from the interrupt
instruction to return the CPU to the execution state prior to the interrupt.

a.interrupt request line

b.device driver

c.interrupt handler

d.All of these

Q136. The ______ register is read by the host to get input.

a. ow in

b. ow out

c.data in

https://admin.myslate.sixphrase.com/test/preview?test_id=1444a088-f636-4422-8f78-3da9616763a5&branch_id=331ab009-cfbf-44c0-b68b-8d6bc1103e93&isprint=true 35/136
6/24/2019 Six Phrase - mySlate

d.data out

Q137. The ______ register is written by the host to send output.

a.status

b.control

c.data in

d.data out

Q138. The CPU hardware has a wire called __________ that the CPU senses after executing every instruction.

a.interrupt request line

b.interrupt bus

c.interrupt receive line

d.interrupt sense line

Q139. The _________ are reserved for events such as unrecoverable memory errors.

a.non-maskable interrupts

b.blocked interrupts

c.maskable interrupts

d.None of these

Q140. The hardware mechanism that allows a device to notify the CPU is called _______.

a.polling

b.interrupt

c.driver

d.controlling

Q141. Which of the following is not a valid type of polymorphism?

https://admin.myslate.sixphrase.com/test/preview?test_id=1444a088-f636-4422-8f78-3da9616763a5&branch_id=331ab009-cfbf-44c0-b68b-8d6bc1103e93&isprint=true 36/136
6/24/2019 Six Phrase - mySlate

a.adhoc polymorphism

b.imperative polymorphism

c.predicative polymorphism

d.inclusion polymorphism

Q142. What is the function used to describe the situation, when a function in base class is rede ned in inherited class?

a.Inheritance

b.Overriding

c.Overloading

d.Encapsulation

Q143. How can a call to an overloaded function be ambiguous?

a.By misspelling the name

b.There might be two or more functions with the same name

c.There might be two or more functions with equally appropriate signatures

d.None of these

Q144. A complete binary tree with the property that the value at each node is at least as large as the values at its children is known as

a.Binary search tree

b.AVL tree

c.Completely balanced tree

d.Heap

Q145. Which of the following correctly describes overloading of functions?

a.Virtual polymorphism

b.Transient polymorphism

c.Ad-hoc polymorphism
https://admin.myslate.sixphrase.com/test/preview?test_id=1444a088-f636-4422-8f78-3da9616763a5&branch_id=331ab009-cfbf-44c0-b68b-8d6bc1103e93&isprint=true 37/136
6/24/2019 Six Phrase - mySlate

d.Pseudo polymorphism

Q146. Which of the following operator is overloaded for object cout?

a.>>

b.<< c.+ d.= Answer:a 7.Which of the following operators cannot be


overloaded? a.[] b.->

c.?:

d.*

Q147. Which of the following is a mechanism of static polymorphism?

a.Operator overloading

b.Function overloading

c.Templates

d.All of the above

Q148. Which of the following keyword is used to overload an operator?

a.Overload

b.Operator

c.Friend

d.Override

Q149. The operator << when overloaded in a class

a.must be a member function

b.must be a non member function

c.can be both (A) & (B) above

d.cannot be overloaded

Q150. Which of this is used to skip one iteration:

https://admin.myslate.sixphrase.com/test/preview?test_id=1444a088-f636-4422-8f78-3da9616763a5&branch_id=331ab009-cfbf-44c0-b68b-8d6bc1103e93&isprint=true 38/136
6/24/2019 Six Phrase - mySlate

A) break

B) continue

C) goto

D) return

Q151. Which of the following does not require to include math.h header le?

A) pow()

B) rand()

C)sqrt()

D) sinh()

Q152. Which has the highest precision?

A. oat

B. double

C. unsigned long int

D. Long int

Q153. Choose the correct statement


while (0 == 0) { }

A) It has syntax error as there are no statements within braces {}

B) It will run forever

C) It compares 0 with 0 and since they are equal it will exit the loop
immediately

D) It has syntax error as the same number is being compared with itself

Q154. Guess the output:


main()
{
printf(“%d”, sizeof(‘a’));
//same as → sizeof(97)
}

https://admin.myslate.sixphrase.com/test/preview?test_id=1444a088-f636-4422-8f78-3da9616763a5&branch_id=331ab009-cfbf-44c0-b68b-8d6bc1103e93&isprint=true 39/136
6/24/2019 Six Phrase - mySlate

A) 2 or 4

B) 1 or 3

C) Garbage value

D) ASCII value of a

Q155. Predict the output of following code:


main()
{
int a=10,x;
x= a– + ++a;
printf(“%d”,x);
}

A) 19

B) 20

C) 22

D) 23

Q156. Predict the output of following code:


main()
{
int a=b=c=d=10;
printf(“%d,%d,%d,%d”,a,b,c,d);
}

A) Error

B) 10,10,10,10

C) Garbage Value,Garbage Value,Garbage Value,10

D) Garbage Value,Garbage Value,Garbage Value,Garbage Value

Q157. Select the missing statement?


#include
long int fact(int n);
int main()
{
\\missing statement
}
long int fact(int n)
{
if(n>=1)
return n*fact(n-1);
else
return 1;
}

A) printf(“%ll\n”,fact(5));

https://admin.myslate.sixphrase.com/test/preview?test_id=1444a088-f636-4422-8f78-3da9616763a5&branch_id=331ab009-cfbf-44c0-b68b-8d6bc1103e93&isprint=true 40/136
6/24/2019 Six Phrase - mySlate

B) printf(“%u\n”,fact(5));

C) printf(“%d\n”,fact(5));

D) printf(“%ld\n”,fact(5));

Q158. If a function’s return type is not explicitly de ned then it’s default to ______ (In C).

A) int

B) oat

C) void

D) Error

Q159. How many times the below loop will be executed?


#include
int main()
{
int i;
for(i=0;i<5;i++) printf(“Hello\n”); }

A) 5

B) 1

C) 0

D) 3 

Q160. How many times loop will executed ?


#include
int main()
{
int x,y;
for(x=5;x>=1;x–)
{
for(y=1;y<=x;y++)
printf(“%d\n”,y);
}
}

a) 11

b) 13

c) 15

d) 10

https://admin.myslate.sixphrase.com/test/preview?test_id=1444a088-f636-4422-8f78-3da9616763a5&branch_id=331ab009-cfbf-44c0-b68b-8d6bc1103e93&isprint=true 41/136
6/24/2019 Six Phrase - mySlate
Q161. atoi() function is used for:

a)convert ASCII character to integer value

b)convert a character string to its equivalent integer value

c)gets index value of character in an array

d)converts an array of characters to array of equivalent integers

Q162. Which of the following is NOT declared in string.h ?

a) strlen()

b) strcpy()

c) strptr()

d) strupr()

Q163. . which of the below function is NOT declared in math.h ?

a) and()

b) pow()

c) exp()

d) acos()

Q164. Where are the local variable stored ?

a) In a Queue

b) In stack Memory

c) In hard Disk

d) In heap Memory

Q165. while declaring parameters for main, the second parameter argv should be declared as

a) char argv[]

https://admin.myslate.sixphrase.com/test/preview?test_id=1444a088-f636-4422-8f78-3da9616763a5&branch_id=331ab009-cfbf-44c0-b68b-8d6bc1103e93&isprint=true 42/136
6/24/2019 Six Phrase - mySlate

b) char argv

c) char ** argv[]

d) char * argv[]

Q166. A memory leak happens when

a) a program allocates memory in heap but forgets to be allocate it

b) when an un-assigned pointer is used is freed using free function

c) when realloc() is called on a pointer that is not allocated

d) A program allocates memory in stack

Q167. Which of the following uses structure?

1. Linked Lists

2. Array of structures

3. All of these

4. Binary Tree

Q168. A pointer variable can be

1. Changed within function.

2. Assigned an integer value.

3. None of these

4. Passed to a function as argument

Q169. Strings are character arrays. The last index of it contains the null-terminated character

1. \t

2. \1

https://admin.myslate.sixphrase.com/test/preview?test_id=1444a088-f636-4422-8f78-3da9616763a5&branch_id=331ab009-cfbf-44c0-b68b-8d6bc1103e93&isprint=true 43/136
6/24/2019 Six Phrase - mySlate

3. \0

4. \n

Q170. Which of the following is a collection of different data types?

1. String

2. Structure

3. Array

4. Files

Q171. Which of the following indicate the end of le ?

a) feof()

b) EOF

c) Both feof() and EOF

d) None of the mentioned

Q172. If a functions return type is not explicitly de ned then it is default to ……….(in C).

a) int

b) oat

c) void

d) error

Q173. Where the local variable is stored ?

a) Disk

b) Stack

c) Heap

d) Register

https://admin.myslate.sixphrase.com/test/preview?test_id=1444a088-f636-4422-8f78-3da9616763a5&branch_id=331ab009-cfbf-44c0-b68b-8d6bc1103e93&isprint=true 44/136
6/24/2019 Six Phrase - mySlate
Q174. How many times loop will executed ?
#include
int main()
{
int i;
for(i=0;i<5;i++)
{
printf(“Hello\n”);
}
}

a) 0

b) 1

c) 3

d) 5

Q175. What is dangling pointer?

a) points to garbage value

b) points to function

c) Both A and B

d) None of these

Q176. what is the purpose of ftell ?

a)to get the current le position

b)to get the current le attribute

c)to get the current le status

d)to get the current le name

Q177. What is recursion ?

a) looping

b) a function calls another function repeatedly

c) a fnction calls repeatedly

d) function calls itself repeatedly

https://admin.myslate.sixphrase.com/test/preview?test_id=1444a088-f636-4422-8f78-3da9616763a5&branch_id=331ab009-cfbf-44c0-b68b-8d6bc1103e93&isprint=true 45/136
6/24/2019 Six Phrase - mySlate
Q178. What is the similarity between enum and struct ?

a) can assign new values

b) can create new data types

c) nothing in common

d) they are same

Q179. which of the following is not a fundamental datatype?

a) Enum

b) unsigned long int

c) Long int

d) double

Q180. How many times hello will print ?


#include
int main(void)
{
int i;
for(i=0;i<5;i++);
printf(“hello”);
}

a) Compilation error

b) Runtime error

c) 4

d) 1

Q181. What function should be used to free the memory allocated by calloc() ?

1. free();

2. malloc(variable_name, 0)

3. dealloc();

4. memalloc(variable_name, 0)

https://admin.myslate.sixphrase.com/test/preview?test_id=1444a088-f636-4422-8f78-3da9616763a5&branch_id=331ab009-cfbf-44c0-b68b-8d6bc1103e93&isprint=true 46/136
6/24/2019 Six Phrase - mySlate
Q182. In the standard library of C programming language, which of the following header le is designed for basic mathematical
operations?

1. conio.h

2. stdio.h

3. math.h

4. dos.h

Q183. int **ptr; is?

1. Pointer to integer

2. None of these

3. Pointer to pointer

4. Invalid declaration

Q184. Which of the following special symbol allowed in a variable name?

1. (underscore)

2. – (hyphen)

3. | (pipeline)

4. * (asterisk)

Q185. All keywords in C are in

1. Uppercase letters

2. None of these

3. Lowercase letters

4. Camel Case letters

Q186. What should the program below print?


#include <stdio.h>
#include <string.h>
#include <stdlib.h>
void myfunc(char** param){
https://admin.myslate.sixphrase.com/test/preview?test_id=1444a088-f636-4422-8f78-3da9616763a5&branch_id=331ab009-cfbf-44c0-b68b-8d6bc1103e93&isprint=true 47/136
6/24/2019 ++param; Six Phrase - mySlate

}
int main(){
char* string = (char*)malloc(64);
strcpy(string, “hello_World”);
myfunc(&string);
myfunc(&string);
printf(“%s\n”, string);
// ignore memory leak for sake of quiz
return 0;
}

1. hello_World

2. ello_World

3. lo_World

4. llo_World

Q187. What is the output of this C code?


#include <stdio.h>
void main()
{
int k = 5;
int *p = &k;
int **m = &p;
printf(“%d%d%d\n”, k, *p, **p);
}

a) 5 5 5

b) 5 5 junk

c) 5 junk junk

d) Compile time error

Q188. Which of the following statements about stdout and stderr are true?

a) They both are the same

b) Run time errors are automatically displayed in stderr

c) Both are connected to the screen by default.

d) stdout is line buffered but stderr is unbuffered.

Q189. Given the below statements about C programming language;


1) main() function should always be the rst function present in a C program le
2) all the elements of an union share their memory location
3) A void pointer can hold address of any type and can be typecasted to any type
4) A static variable hold random junk value if it is not initialised
Which of the above are correct statements?

https://admin.myslate.sixphrase.com/test/preview?test_id=1444a088-f636-4422-8f78-3da9616763a5&branch_id=331ab009-cfbf-44c0-b68b-8d6bc1103e93&isprint=true 48/136
6/24/2019 Six Phrase - mySlate

A) 2,3

B) 1,2

C) 1,2,3

D) 1,2,3,4

Q190. If a function is de ned as static, it means

A) The value returned by the function does not change

B) all the variable declared inside the function automatically will be assigned
initial value of zero

C) It should be called only within the same source code/program le.

D) None of the other choices as it is wrong to add static pre x to a function

Q191. The function ____ obtains block of memory dynamically.

a) calloc

b) malloc

c) Both calloc & malloc 

d) free

Q192. What is the default return-type of getchar()?

a) char

b) int 

C. char *

D. reading character doesn’t require a return-type

Q193. Memory allocation using malloc() is done in?

a) Static area

https://admin.myslate.sixphrase.com/test/preview?test_id=1444a088-f636-4422-8f78-3da9616763a5&branch_id=331ab009-cfbf-44c0-b68b-8d6bc1103e93&isprint=true 49/136
6/24/2019 Six Phrase - mySlate

b) Stack area

c) Heap area

d) Both Stack & Heap area

Q194. What is the sizeof(char) in a 32-bit C compiler?

a) 1 bit

b) 2 bits

c) 1 Byte

d) 2 Bytes

Q195. What type of value does sizeof return?

a) char

b) short

c) unsigned int

d) long

Q196. Which one is used during memory deallocation in C?

a) remove(p);

b) delete(p);

c) free(p);

d) terminate(p);

Q197. What is the output of this C code?


#include <stdio.h>
void main()
{
int x = 97;
int y = sizeof(x++);
printf(“x is %d”, x);
}

a) x is 97 
https://admin.myslate.sixphrase.com/test/preview?test_id=1444a088-f636-4422-8f78-3da9616763a5&branch_id=331ab009-cfbf-44c0-b68b-8d6bc1103e93&isprint=true 50/136
6/24/2019 Six Phrase - mySlate

b) x is 98

c) x is 99

d) Run time error

Q198. Which is the character array used to accept command line arguments?

A) char argv

B) char* argv[]

C) char argv[]

D) char* argv

Q199. Which is not a string function?

A) strstr

B)strcmp

C) strupr

D) strchr

Q200. What is the task of pre-processor?

A) Expanding

B) Compiling

C) Linking

D) All of the above

Q201. Which of the following is true?

A) realloc() can change the memory size of arrays

B) Unary operator works on only one operand

https://admin.myslate.sixphrase.com/test/preview?test_id=1444a088-f636-4422-8f78-3da9616763a5&branch_id=331ab009-cfbf-44c0-b68b-8d6bc1103e93&isprint=true 51/136
6/24/2019 Six Phrase - mySlate

C) Struct and Union works in same way.

D) None of the above

Q202. In _____________tree, the heights of the two child subtrees of any node differ by at most one

Binary tree

Red black tree

 Splay tree

AVL tree

Q203. In a heap, element with the greatest key is always in the ___________ node

leaf

 root

rst node of left sub tree

rst node of right sub tree

Q204. Key value pair is usually seen in

Hash tables

Heaps

Both a and b

Skip list

Q205. Breadth First search is used in

Binary trees

Stacks

Graphs

Both a and c

Q206. Which of the following ways is an in-order traversal?

https://admin.myslate.sixphrase.com/test/preview?test_id=1444a088-f636-4422-8f78-3da9616763a5&branch_id=331ab009-cfbf-44c0-b68b-8d6bc1103e93&isprint=true 52/136
6/24/2019 Six Phrase - mySlate

root->left sub tree-> right sub tree

root->right sub tree-> left sub tree

right sub tree-> left sub tree->root

left sub tree-> root->right sub tree

Q207. The time required in best case for search operation in binary tree is

O(n)

O(1)

O(2n)

O(log 2n)

Q208. Which of the following statements hold true for binary trees?

The left subtree of a node contains only nodes with keys less than the node's
key

The right subtree of a node contains only nodes with keys greater than the
node's key.

Both a and b

Both left and right subtree nodes contains only nodes with keys less than the
node's key

Q209. What is the output of the program?


#include<stdio.h>
int main()
{
structemp
   {
       char name[20];
int age;
        oat sal;
   };
structemp e = {"Tiger"};
printf("%d, %f\n", e.age, e.sal);
   return 0;
}

0, 0.000000

Garbage values

Error

None of these

https://admin.myslate.sixphrase.com/test/preview?test_id=1444a088-f636-4422-8f78-3da9616763a5&branch_id=331ab009-cfbf-44c0-b68b-8d6bc1103e93&isprint=true 53/136
6/24/2019 Six Phrase - mySlate
Q210. For a typical program, the input is taken using

a) scanf

b) Files

c) Command-line

d) All of the mentioned

Q211. What will be the output of the program?


#include<stdio.h>
int X=40;
int main()
{
int X=20;
printf("%d\n", X);
   return 0;
}

20

40

Error

No Output

Q212. What is the output of the program?


#include<stdio.h>
int main()
{
int x = 10, y = 20, z = 5, i;
   i = x < y < z;
printf("%d\n", i);
   return 0;
}

Error

None of these

Q213. In the following program how long will the for loop get executed?
#include<stdio.h>
int main()
{
int i=5;
   for(;scanf("%s", &i); printf("%d\n", i));
   return 0;
}

The for loop would not get executed at all


https://admin.myslate.sixphrase.com/test/preview?test_id=1444a088-f636-4422-8f78-3da9616763a5&branch_id=331ab009-cfbf-44c0-b68b-8d6bc1103e93&isprint=true 54/136
6/24/2019 Six Phrase - mySlate

The for loop would get executed only once

The for loop would get executed in nite times

The for loop would get executed 5 times

Q214. Point out the error in the following program (if it is compiled with Turbo C compiler).
#include<stdio.h>
int main()
{
   display();
   return 0;
}
void display()
{
printf("Welcome");
}

No Error

display() doesn't get invoked

display() is called before it is de ned

None of these

Q215. Point out the error in the following program.


#include<stdio.h>
int main()
{
   void v = 0;

printf("%d", v);

   return 0;

 Error: Declaration syntax error 'v' (or) Size of v is unknown or zero.

Program terminates abnormally.

No error

None of these.

Q216. Which of the following is correct about err used in the declaration given below?
typedefenum error { warning, test, exception } err;

It is a typedef for enum error.

It is a variable of type enum error.

The statement is erroneous.

It is a structure

https://admin.myslate.sixphrase.com/test/preview?test_id=1444a088-f636-4422-8f78-3da9616763a5&branch_id=331ab009-cfbf-44c0-b68b-8d6bc1103e93&isprint=true 55/136
6/24/2019 Six Phrase - mySlate
Q217. Which of the following correctly represents a long double constant?

6.68

6.68L

6.68f

6.68LF

Q218. Which Data Structure is used to perform Recursion?

 Queue

Stack

Linked List

Tree

Q219. What’s the output of the following code ?

intdoSomething(int a, int b)
{
if (b==1)
return a;
else
return a + doSomething(a,b-1);
}
doSomething(2,3);

Q220. What will happen if the base condition is not de ned in recursion

Stack under ow

Stack over ow

None of these

Both A and B

Q221. What is the output of the following program?


https://admin.myslate.sixphrase.com/test/preview?test_id=1444a088-f636-4422-8f78-3da9616763a5&branch_id=331ab009-cfbf-44c0-b68b-8d6bc1103e93&isprint=true 56/136
6/24/2019 int rec(intnum) Six Phrase - mySlate

{
return (num) ? num%10 + rec(num/10):0;
}
main(){
printf("%d",rec(4567));
}

12

22

21

Q222. What is the output of the following program?


int something(int number)
{
if(number <= 0)
return 1;                            
else
return number * something(number-1);  
}
something(4);

12

24

Q223. What is the output of func(3,8)?


intfunc(int a, int b){
if(b==0)
return 0;
if(b==1)
return a;
return a + func(a,b-1);
}

24

11

22

21

Q224. void print(int n)


{
if (n == 0)
return;
printf("%d", n%2);
print(n/2);

https://admin.myslate.sixphrase.com/test/preview?test_id=1444a088-f636-4422-8f78-3da9616763a5&branch_id=331ab009-cfbf-44c0-b68b-8d6bc1103e93&isprint=true 57/136
6/24/2019 Six Phrase - mySlate

What will be the output of print(12).

0011

1100

1001

1000

Q225. int sum(int n) {


if (n==0)
return n;
else
return n + sum(n-1);   
}

What will be the output of sum(8).

40

36

15

Q226. The average time required to perform a successful sequential search for an element in an array A(1 : n) is given by

(n + 1)/2

log2n

n(n + 1)/2

n2

Q227. The time complexity of linear search algorithm over an array of n elements is

O(n)

O (log2 n)

O(n log2 n)

O (n2)

Q228. Using the standard algorithm, what is the time required to determine that a number n is prime?

https://admin.myslate.sixphrase.com/test/preview?test_id=1444a088-f636-4422-8f78-3da9616763a5&branch_id=331ab009-cfbf-44c0-b68b-8d6bc1103e93&isprint=true 58/136
6/24/2019 Six Phrase - mySlate

Linear time

Logarithmic time

Constant time

Quadratic time

Q229. The average time required to perform a successful sequential search for an element in an array A (1 : n) is given by

(n+1)/2

n (n + 1)/2

log(n/2)

n2

Q230. Which of the following is false?

A serial search begins with the rst array element

A serial search continues searching, element by element, either until a match


is found or until the end of the array is encountered

A serial search is useful when the amount of data that must be search is
small

For a serial search to work, the data in the array must be arranged in either
alphabetical or numerical order

Q231. A _____ search begins the search with the element that is located in the middle of the array

serial

random

parallel

binary 

Q232. Which of the following sorting algorithms does not have a worst case running time of O(n2)?

Insertion sort

Merge sort

https://admin.myslate.sixphrase.com/test/preview?test_id=1444a088-f636-4422-8f78-3da9616763a5&branch_id=331ab009-cfbf-44c0-b68b-8d6bc1103e93&isprint=true 59/136
6/24/2019 Six Phrase - mySlate

Quick sort

Bubble sort

Q233. The time required to search an element in a linked list of length n is

O(log2 n)

O(n)

O(1)

O(n2)

Q234. For a linear search in an array of n elements the time complexity for best, worst and average case are ......., ....... and ........
respectively

O(n), O(1), and O(n/2)

O(1), O(n) and O(n/2)

O(1),O(n) and O(n)

O(1), O(n) and (n-1/2)

Q235. The worst case time required to search a given element in a sorted linked list of length n is

O(1)

O(log2 n)

O(n)

O(n log2 n)

Q236. In _____________tree, the heights of the two child subtrees of any node differ by at most one

Binary tree

Red black tree

Splay tree

AVL tree

https://admin.myslate.sixphrase.com/test/preview?test_id=1444a088-f636-4422-8f78-3da9616763a5&branch_id=331ab009-cfbf-44c0-b68b-8d6bc1103e93&isprint=true 60/136
6/24/2019 Six Phrase - mySlate
Q237. In a heap, element with the greatest key is always in the ___________ node

leaf

root

rst node of left sub tree

rst node of right sub tree

Q238. Key value pair is usually seen in

Hash tables

Heaps

Both a and b

Skip list

Q239. An empty list is the one which has no

nodes

data

both a and b

address

Q240. Breadth First search is used in

Binary trees

Stacks

Graphs

Both a and c

Q241. Which of the following ways is a in-order traversal?

Root->left sub tree-> right sub tree

Root->right sub tree-> left sub tree

https://admin.myslate.sixphrase.com/test/preview?test_id=1444a088-f636-4422-8f78-3da9616763a5&branch_id=331ab009-cfbf-44c0-b68b-8d6bc1103e93&isprint=true 61/136
6/24/2019 Six Phrase - mySlate

right sub tree-> left sub tree->Root

left sub tree-> root->right sub tree

Q242. The time required in best case for search operation in binary tree is

O(n)

O(1)

O(2n)

O(log 2n)

Q243. Which of the following is not a disadvantage to the usage of array?

Fixed size

You know the size of the array prior to allocation

Insertion based on position

Accessing elements at speci ed positions 

Q244. Which of the following statements hold true for binary trees?

The left subtree of a node contains only nodes with keys less than the node's
key

The right subtree of a node contains only nodes with keys greater than the
node's key.

both a and b

Noth left and right subtree nodes contains only nodes with keys less than the
node's key

Q245. Which of the following points is/are true about Linked List data structure when it is compared with array

Arrays have better cache locality that can make them better in terms of
performance.

It is easy to insert and delete elements in Linked List

Random access is not allowed in a typical implementation of Linked Lists

https://admin.myslate.sixphrase.com/test/preview?test_id=1444a088-f636-4422-8f78-3da9616763a5&branch_id=331ab009-cfbf-44c0-b68b-8d6bc1103e93&isprint=true 62/136
6/24/2019 Six Phrase - mySlate

The size of array has to be pre-decided, linked lists can change their size any
time.

All of the above

Q246. arrays are best suited …..

for relatively permanent collections of data.

for the size of the structure and the data in the structure are constantly
changing.

data structure

for none of above situation

Q247. Linked lists are best suited …..

for relatively permanent collections of data.

for the size of the structure and the data in the structure are constantly
changing.

data structure

for none of above situation

Q248. The link eld in a node contains:

 data of next node

 data of previous node

 address of the next node

 data of current node

Q249.  A linear collection of data elements where the linear node is given by means of pointer is called?

Linked list

Node list

Primitive list

None of the mentioned

https://admin.myslate.sixphrase.com/test/preview?test_id=1444a088-f636-4422-8f78-3da9616763a5&branch_id=331ab009-cfbf-44c0-b68b-8d6bc1103e93&isprint=true 63/136
6/24/2019 Six Phrase - mySlate
Q250. In linked list each node contain minimum of two elds. One eld is data eld to store the data second eld is?

Pointer to character

Pointer to integer

Pointer to node

Node

Q251. In Linked List implementation, a node carries information regarding

Data

Link

Data and Link

None of the mentioned

Q252. Which of these is an application of linked lists?

To implement le systems

For separate chaining in hash-tables

To implement non-binary trees

All of the mentioned

Q253. Linked list data structure offers considerable saving in

Computational Time

Space Utilization

Space Utilization and Computational Time

None of the mentioned

Q254. The operation of processing each element in the list is known as ……

sorting

merging

https://admin.myslate.sixphrase.com/test/preview?test_id=1444a088-f636-4422-8f78-3da9616763a5&branch_id=331ab009-cfbf-44c0-b68b-8d6bc1103e93&isprint=true 64/136
6/24/2019 Six Phrase - mySlate

inserting

traversal

Q255. The dummy header in linked list contain …..

rst record of the actual data

last record of the actual data

pointer to the last record of the actual data

middle record of the actual data

Q256.  A …… indicates the end of the list.

Guard

Sentinel

End pointer

Last pointer

Q257. A run list is ……

small batches of records from a le

number of elements having same value

number of records

number of les in external storage

Q258. A linear list in which the pointer points only to the successive node is ……

singly linked list

circular linked list

doubly linked list

none of the above

https://admin.myslate.sixphrase.com/test/preview?test_id=1444a088-f636-4422-8f78-3da9616763a5&branch_id=331ab009-cfbf-44c0-b68b-8d6bc1103e93&isprint=true 65/136
6/24/2019 Six Phrase - mySlate
Q259.  What kind of list is best to answer questions such as: “What is the item at position n?”

 Singly-linked lists.

 Doubly-linked or singly-linked lists are equally best.

 Doubly-linked lists.

 Lists implemented with an array.

Q260. Memory is allocated dynamically to a data structure during execution by ——- function.

 malloc()

 realloc()

 Calloc()
 

all the above

Q261. To create a linked list, we can allocate space and make something point to it, by
writing:
struct-name *pointer-variable;
Which of the following statement will correctly allocate the space

pointer-variable=(struct-name*)malloc(sizeof(struct-name)); 

pointer-variable =(struct-name)malloc(sizeof(struct struct-name)); 

pointer-variable =(struct-name)alloc(sizeof(struct struct-name)); 

pointer-variable =(struct-name*)alloc(sizeof(*struct-name)); 

Q262. Consider the following de nition in c programming language

struct node
{
  int data;
  struct node * next;
}
typedef struct node NODE;
NODE *ptr;

Which of the following c code is used to create new node?

ptr = (NODE*)malloc(sizeof(NODE));

ptr = (NODE*)malloc(NODE);

ptr = (NODE*)malloc(sizeof(NODE*));
https://admin.myslate.sixphrase.com/test/preview?test_id=1444a088-f636-4422-8f78-3da9616763a5&branch_id=331ab009-cfbf-44c0-b68b-8d6bc1103e93&isprint=true 66/136
6/24/2019 Six Phrase - mySlate

ptr = (NODE)malloc(sizeof(NODE));

Q263. Linked list is considered as an example of ___________ type of memory allocation.

Dynamic

Static

Compile time

None of the mentioned

Q264.  ………. may take place only when there is some minimum amount(or) no space left in free storage list.

Memory management

Garbage collection

Recycle bin

None of the above

Q265. Suppose that p is a pointer variable that contains the NULL pointer.
What happens if your program tries to read or write *p?

 A syntax error always occurs at compilation time.

 The results are unpredictable.

 A run-time error always occurs when *p is evaluated.

 A run-time error always occurs when the program nishes.

Q266. In a single linked list which operation depends on the length of the list.

 Delete the last element of the list

 Add an element before the rst element of the list

 Delete the rst element of the list


 

Interchange the rst two elements of the list

Q267. Consider an implementation of unsorted singly linked list. Suppose it has its representation with a head pointer only.
Given the representation, which of the following operation can be implemented in O(1) time?
i)Insertion at the front of the linked list
https://admin.myslate.sixphrase.com/test/preview?test_id=1444a088-f636-4422-8f78-3da9616763a5&branch_id=331ab009-cfbf-44c0-b68b-8d6bc1103e93&isprint=true 67/136
6/24/2019 ii)Insertion at the end of the linked list Six Phrase - mySlate

iii) Deletion of the front node of the linked list


iv)Deletion of the last node of the linked list

I and II

I and III

I, II and III

I, II and IV

Q268. What does the following function do for a given Linked List with rst node as head?

void fun1(struct node* head)


{
  if(head == NULL)
  return;
  fun1(head->next);
  printf("%d ", head->data);
}

Prints all nodes of linked lists

Prints all nodes of linked list in reverse order

Prints alternate nodes of Linked List

Prints alternate nodes in reverse order

Q269. The following while loop is to remove duplicates


from an existing list having a head pointer pointing
to the rst node.Which code will replace ____ 

current=head;
while(current->next!=NULL)
{
if (current->data == current->next->data)
{
____
}
else
{
current = current->next;
}
}?

p=current->next->next;free(current);current->next = p; 

p=current->next;free(p); 

p=current->next;free(current->next);current->next=p; 

p= current->next->next;free(current->next);current->next = p; 

Q270.  "p" and "q" are pointers to a node of the linked list,
"head" points to the rst node of the list, "next"
https://admin.myslate.sixphrase.com/test/preview?test_id=1444a088-f636-4422-8f78-3da9616763a5&branch_id=331ab009-cfbf-44c0-b68b-8d6bc1103e93&isprint=true 68/136
6/24/2019 points to the next node in the list, which of the Six Phrase - mySlate

following is true for the following piece of code: 

for (p=head, q = head; p!=NULL ;q = p) 


{ p = p->next; 
free(q);
}?

Deletes all nodes 

Deletes all but the last node 

Does not delete any node 

The program will crash 

Q271. What does the following function return, if q contains the address of the rst element?

int function(NODE *q)



int c = 0;
while( q != NULL)

q = q->link;
c++;

return (c);
}?

The value of the last node of the linked list 

The value of the rst elements of the linked list 

The address of the last element of the linked list 

The number of elements in a linked list 

Q272. What is the output of following function for start pointing to rst node of following linked list? 1->2->3->4->5->6
void fun(struct node* start)
{
 if(start == NULL)
  return;
 printf("%d ", start->data); 
  
 if(start->next != NULL )
  fun(start->next->next);
 printf("%d ", start->data);
}

146641

135135

1235

135531

Q273. struct node


https://admin.myslate.sixphrase.com/test/preview?test_id=1444a088-f636-4422-8f78-3da9616763a5&branch_id=331ab009-cfbf-44c0-b68b-8d6bc1103e93&isprint=true 69/136
6/24/2019 { Six Phrase - mySlate

  int data;
  struct node *next;
};
typedef struct node NODE;

Structure declaration

Creates new node

Compile time error

Run time error

Q274. void DataList(int num)


{
  NODE *tptr=NULL,*prev=NULL,*newnode=NULL;
  newnode = (NODE*)malloc(sizeof(NODE));
  newnode->data=num;
  newnode->next=NULL;
  if(start==NULL)
    start = newnode;
  else
  {
    for(tptr=start; tptr && num>tptr->data; prev=tptr, tptr=tptr->next);
    if(tptr==start)
    {

      newnode->next = tptr;
      start = newnode;
    }
    else
    {
      prev->next = newnode;
      newnode->next = tptr;
    }
  }
}

Adds new data to list

Delete data in list

Search for data in a list

Error

Q275. void DataList(int data)


{
 NODE *tptr=NULL,*prev=NULL;
 for(tptr=start; data>tptr->data; prev=tptr, tptr=tptr->next);
 if(tptr==start)
  start = tptr->next;
 else if(tptr!=NULL)
  prev->next = tptr->next;
 else
  prev->next = NULL;
 free(tptr);
}

https://admin.myslate.sixphrase.com/test/preview?test_id=1444a088-f636-4422-8f78-3da9616763a5&branch_id=331ab009-cfbf-44c0-b68b-8d6bc1103e93&isprint=true 70/136
6/24/2019 Six Phrase - mySlate

Adds new data to list

Delete data from a list

Search for data in a list

Error

Q276. struct node


{
  int data;
  struct node *prev,*next;
};
typedef struct node NODE;

Error

structure declaration for DLL 

Compile time error

Run time error

Q277. A double linked list is declared as follows:


struct dllist
{
struct dllist *fwd, *bwd;
int data;
}

Where fwd and bwd represents forward and backward links to adjacent
elements of the list. Which among the following segments of code
deletes the element pointed to by X from the double linked list, if it is
assumed that X points to neither the rst nor last element of the list?

 X -> bwd -> fwd = X -> bwd; X -> fwd -> bwd = X -> fwd

 X -> bwd -> fwd = X -> fwd; X -> fwd -> bwd = X -> bwd
 

X -> bwd -> bwd = X -> bwd; X -> fwd -> fwd = X -> fwd

 X -> bwd -> bwd = X -> fwd; X -> fwd -> fwd = X -> bwd

Q278. Which among the following segment of code deletes the element
pointed to by X from the double linked list, if it is assumed that X
points to the rst element of the list and start pointer points to
beginning of the list?

 start = X -> fwd; start -> bwd = NULL;

 start = X -> fwd; X -> fwd = NUL

https://admin.myslate.sixphrase.com/test/preview?test_id=1444a088-f636-4422-8f78-3da9616763a5&branch_id=331ab009-cfbf-44c0-b68b-8d6bc1103e93&isprint=true 71/136
6/24/2019 Six Phrase - mySlate

 X -> bwd = X -> fwd; X -> fwd = X -> bwd

 X -> bwd -> bwd = X -> bwd; X -> fwd -> fwd = X -> fwd

Q279. Analyse this structure and choose the correct option.

typedef struct node_s 


{
struct node_s * prev;
struct node_s * next;
} node_t ; ?

This could be a node in a doubly linked list 

The syntax is incorrect 

A linking error would occur because no data is present 

None of the above

Q280. Which of the following is two way lists?

Grounded header list

Circular header list

Linked list with header and trailer nodes

List traversed in two directions

Q281. Consider the following function to traverse a linked list. 


void traverse(struct Node *head) 
{  
while (head->next != NULL)  
{    
    printf("%d ", head->data);    
    head = head->next;  
 }
 }
 
Which of the following is FALSE about above function?
 

The function may crash when the linked list is empty

The function doesn't print the last node when the linked list is not empty

The function is implemented incorrectly because it changes head 

None of the above

Q282. void DataList(int num)


{
  NODE *tptr=NULL,*prev=NULL,*newnode=NULL;
https://admin.myslate.sixphrase.com/test/preview?test_id=1444a088-f636-4422-8f78-3da9616763a5&branch_id=331ab009-cfbf-44c0-b68b-8d6bc1103e93&isprint=true 72/136
6/24/2019   newnode = (NODE*)malloc(sizeof(NODE)); Six Phrase - mySlate

  newnode->data=num;
  newnode->prev=NULL;
  newnode->next=NULL;
  if(start==NULL)
    start = newnode;
  else
  {
    for(tptr=start; tptr&&tptr->next && num>tptr->data; tptr=tptr->next);
    if(tptr==start)
    {

      newnode->next = tptr;
      tptr->prev = newnode;
      start = newnode;
    }
    else if(tptr!=NULL&&tptr->next!=NULL)
    {
      tptr->prev->next = newnode;
      newnode->prev = tptr->prev;
      newnode->next = tptr;
      tptr->prev = newnode;
    }
    else
    {
      tptr->next = newnode;
      newnode->prev = tptr;
    }
  }
}

Add new data into a list in DLL

Delete data from a list in DLL

Add new data into a list in sLL

Error

Q283. void DataList(int data)


{
 NODE *tptr=NULL;
 for(tptr=start; tptr&&tptr->next&&data!=tptr->data; tptr=tptr->next);
 if(tptr==start)
 {
   start = tptr->next;
   start->prev = NULL;
 }
 else if(tptr!=NULL&&tptr->next!=NULL)
 {
   tptr->prev->next = tptr->next;
   tptr->next->prev = tptr->prev;
 }

 else
  tptr->prev->next = NULL;
 free(tptr);
}

Add new data into a list in DLL

Delete data from a list in DLL

Search for data in a list

https://admin.myslate.sixphrase.com/test/preview?test_id=1444a088-f636-4422-8f78-3da9616763a5&branch_id=331ab009-cfbf-44c0-b68b-8d6bc1103e93&isprint=true 73/136
6/24/2019 Six Phrase - mySlate

Error

Q284. Process of inserting an element in stack is called ____________

Create

Push

Evaluation

Pop

Q285. Process of removing an element from stack is called __________

Create

Push

Evaluation

Pop

Q286. Pushing an element into stack already having ve elements and stack size of 5 , then stack becomes

Over ow

Crash

Under ow

User ow

Q287. In a stack, if a user tries to remove an element from empty stack it is called _________

Under ow

Empty collection

Over ow

Garbage Collection

Q288. Entries in a stack are “ordered”. What is the meaning of this statement?

https://admin.myslate.sixphrase.com/test/preview?test_id=1444a088-f636-4422-8f78-3da9616763a5&branch_id=331ab009-cfbf-44c0-b68b-8d6bc1103e93&isprint=true 74/136
6/24/2019 Six Phrase - mySlate

A collection of stacks is sortable

Stack entries may be compared with the ‘<‘ operation

The entries are stored in a linked list

There is a Sequential entry that is one by one

Q289. Which of the following applications may use a stack?

A parentheses balancing program

Tracking of local variables at run time

Compiler Syntax Analyzer

All of the mentioned

Q290. Which of the following is not an inherent application of stack?

Reversing a string

Evaluation of post x expression

Implementation of recursion

Job scheduling

Q291. Which of the following statement(s) about stack data structure is/are NOT correct?

Linked List are used for implementing Stacks

Top of the Stack always contain the new node

Stack is the FIFO data structure

Null link is present in the last node at the bottom of the stack

Q292. Consider the linked list implementation of a stack. Which of the following node is considered as Top of the stack?

First node

Last node

https://admin.myslate.sixphrase.com/test/preview?test_id=1444a088-f636-4422-8f78-3da9616763a5&branch_id=331ab009-cfbf-44c0-b68b-8d6bc1103e93&isprint=true 75/136
6/24/2019 Six Phrase - mySlate

Any node

Middle node

Q293. Consider the following operation performed on a stack of size 5.


Push(1);
Pop();
Push(2);
Push(3);
Pop();
Push(4);
Pop();
Pop();
Push(5);
After the completion of all operation, the number of elements present in stack are

Q294. If the elements “A”, “B”, “C” and “D” are placed in a stack and are deleted one at a time, what is the order of removal?

ABCD

DCBA

DCAB

ABDC

Q295. The data structure required to check whether an expression contains balanced parenthesis is?

Stack

Queue

Array

Tree

Q296. Which data structure is used for implementing recursion?

Queue

https://admin.myslate.sixphrase.com/test/preview?test_id=1444a088-f636-4422-8f78-3da9616763a5&branch_id=331ab009-cfbf-44c0-b68b-8d6bc1103e93&isprint=true 76/136
6/24/2019 Six Phrase - mySlate

Stack

Array

List

Q297. Which data structure is needed to convert in x notation to post x notation?

Branch

Tree

Queue

Stack

Q298. The type of expression in which operator succeeds its operands is?

In x Expression

Pre x Expression

Post x Expression

None of the mentioned

Q299. The post x form of A*B+C/D is?

*AB/CD+

AB*CD/+

A*BC+/D

ABCD+/*

Q300. Convert the following In x expression to Post x form using a stack


x + y * z + (p * q + r) * s, Follow usual precedence rule and assume that the expression is legal.

xyz*+pq*r+s*+

xyz*+pq*r+s+*

xyz+*pq*r+s*+

https://admin.myslate.sixphrase.com/test/preview?test_id=1444a088-f636-4422-8f78-3da9616763a5&branch_id=331ab009-cfbf-44c0-b68b-8d6bc1103e93&isprint=true 77/136
6/24/2019 Six Phrase - mySlate

None of the mentioned

Q301. Convert the following in x expressions into its equivalent post x expressions
(A + B ^D)/(E – F)+G

ABD^+EF–/G+

A B D +^ E F – / G +

A B D ^+ E F/- G +

None of the mentioned

Q302.  Assume that the operators +,-, X are left associative and ^ is right associative.
The order of precedence (from highest to lowest) is ^, X, +, -. The post x expression for the in x expression a + b X c – d ^ e ^ f is

abc X+ def ^^ –

abc X+ de^f^ –

ab+c Xd – e ^f^

-+aXbc^ ^def

Q303. The post x form of the expression (A+ B)*(C*D- E)*F / G is?

AB+ CD*E – FG /**

AB + CD* E – F **G /

AB + CD* E – *F *G /

AB + CDE * – * F *G /

Q304. The pre x form of A-B/ (C * D ^ E) is?

-/*^ACBDE

-ABCD*^DE

-A/B*C^DE

-A/BC*^DE

Q305. The pre x form of an in x expression p + q – r * t is?


https://admin.myslate.sixphrase.com/test/preview?test_id=1444a088-f636-4422-8f78-3da9616763a5&branch_id=331ab009-cfbf-44c0-b68b-8d6bc1103e93&isprint=true 78/136
6/24/2019 Six Phrase - mySlate

+ p-q*rt

– +pqr * t

– +pq * rt

– + * pqrt

Q306. The result of evaluating the post x expression 5, 4, 6, +, *, 4, 9, 3, /, +, * is?

600

350

650

588

Q307. Consider the usual implementation of parentheses balancing program using stack. What is the maximum number of parentheses
that will appear on stack at any instance of time during the analysis of ( ( ) ( ( ) ) ( ( ) ) )?

Q308. Let the following circular queue can accommodate maximum six elements with the following data
front = 2 rear = 4
queue = _______; L, M, N, ___, ___
What will happen after ADD O operation takes place?

front = 2 rear = 5
queue = ______; L, M, N, O, ___

front = 3 rear = 5
queue = L, M, N, O, ___

front = 3 rear = 4
queue = ______; L, M, N, O, ___

front = 2 rear = 4
queue = L, M, N, O, ___

Q309. A linear list of elements in which deletion can be done from one end (front) and insertion can take place only at the other end (rear)
is known as a ?

https://admin.myslate.sixphrase.com/test/preview?test_id=1444a088-f636-4422-8f78-3da9616763a5&branch_id=331ab009-cfbf-44c0-b68b-8d6bc1103e93&isprint=true 79/136
6/24/2019 Six Phrase - mySlate

Queue 

Stack

Tree

Linked list

Q310. A queue is a ?

FIFO (First In First Out) list 

LIFO (Last In First Out) list.

Ordered array

Linear tree

Q311. If the MAX_SIZE is the size of the array used in the implementation of circular queue. How is rear manipulated while inserting an
element in the queue?

rear=(rear%1)+MAX_SIZE

rear=rear%(MAX_SIZE+1)

rear=(rear+1)%MAX_SIZE

rear=rear+(1%MAX_SIZE)

Q312. If the MAX_SIZE is the size of the array used in the implementation of circular queue, array index start with 0, front point to the rst
element in the queue, and rear point to the last element in the queue. Which of the following condition specify that circular queue is
FULL?

Front=rear= -1

Front=(rear+1)%MAX_SIZE

Rear=front+1

Rear=(front+1)%MAX_SIZE

Q313. A circular queue is implemented using an array of size 10. The array index starts with 0, front is 6, and rear is 9. The insertion of
next element takes place at the array index.

0
https://admin.myslate.sixphrase.com/test/preview?test_id=1444a088-f636-4422-8f78-3da9616763a5&branch_id=331ab009-cfbf-44c0-b68b-8d6bc1103e93&isprint=true 80/136
6/24/2019 Six Phrase - mySlate

10

Q314. If the MAX_SIZE is the size of the array used in the implementation of circular queue, array index start with 0, front point to the rst
element in the queue, and rear point to the last element in the queue. Which of the following condition specify that circular queue is
EMPTY?

Front=rear=0

Front= rear=-1

Front=rear+1

Front=(rear+1)%MAX_SIZE

Q315. A data structure in which elements can be inserted or deleted at/from both the ends but not in the middle is?

Queue

Circular queue

Deque

Priority queue

Q316. In linked list implementation of a queue, front and rear pointers are tracked. Which of these pointers will change during an insertion
into a NONEMPTY queue?

Only front pointer

Only rear pointer

Both front and rear pointer

None of the front and rear pointer

Q317. A normal queue, if implemented using an array of size MAX_SIZE, gets full when

Rear=MAX_SIZE-1

Front=(rear+1)mod MAX_SIZE

https://admin.myslate.sixphrase.com/test/preview?test_id=1444a088-f636-4422-8f78-3da9616763a5&branch_id=331ab009-cfbf-44c0-b68b-8d6bc1103e93&isprint=true 81/136
6/24/2019 Six Phrase - mySlate

Front=rear+1

Rear=front

Q318. In linked list implementation of a queue, front and rear pointers are tracked. Which of these pointers will change during an insertion
into EMPTY queue?

Only front pointer

Only rear pointer

Both front and rear pointer

None

Q319. An array of size MAX_SIZE is used to implement a circular queue. Front, Rear, and count are tracked. Suppose front is 0 and rear is
MAX_SIZE -1. How many elements are present in the queue?

Zero

One

MAX_SIZE-1

MAX_SIZE

Q320.
Suppose a circular queue of capacity (n-1) elements is implemented with an array of n elements. Assume that the insertion and
deletion operations are carried out using REAR and FRONT as array index variables, respectively. Initially REAR=FRONT=0. The
conditions to detect queue full and queue is empty are?

Full: (REAR+1)mod n == FRONT


Empty: REAR==FRONT

Full: (REAR+1)mod n == FRONT


Empty: (FRONT+1) mod n == REAR

Full: REAR==FRONT
Empty: (REAR+1) mod n==FRONT

Full: (FRONT+1)mod n==REAR


Empty: REAR==FRONT

Q321. Which of the following is not an advantage of trees? 

https://admin.myslate.sixphrase.com/test/preview?test_id=1444a088-f636-4422-8f78-3da9616763a5&branch_id=331ab009-cfbf-44c0-b68b-8d6bc1103e93&isprint=true 82/136
6/24/2019 Six Phrase - mySlate

Hierarchical structure 

Faster search 

Router algorithms 

Undo/Redo operations in a notepad

Q322.
In ……………………….. ; for any node n, every descendant node’s value in the left subtree of n is less than the value of n and every
descendant node’s value in the right subtree is greater than the value n.

binary tree

binary search tree

AVL tree

binary heap tree

Q323. For nding a node in a …………………, at each stage we ideally reduce the number of nodes we have to check by half.

binary tree

binary search tree

AVL tree

binary heap tree

Q324. The height of a BST is given as h. Consider the height of the tree as the no. of edges in the longest path from root to the leaf. The
maximum no. of nodes possible in the tree is?

2^(h-1) -1

2^(h+1) -1.

2^(h +1)

2^(h-1) +1

Q325. In the best case of BST, the time is on the order of ……………………, but in the worst case it requires linear time.

log2n.

https://admin.myslate.sixphrase.com/test/preview?test_id=1444a088-f636-4422-8f78-3da9616763a5&branch_id=331ab009-cfbf-44c0-b68b-8d6bc1103e93&isprint=true 83/136
6/24/2019 Six Phrase - mySlate

log2(n+1)

n+1

Q326.  …………………. of binary search tree starts by visiting the current node, then its left child and then its right child.

Preorder traversal

In-order traversal

Linear traversal

Post-order traversal

Q327. The number of edges from the root to the node is called __________ of the tree.

Height

Depth

Length

None of the mentioned

Q328. The order with which the nodes are inserted affects the running time of the ……………………. search algorithm.

AVL Tree

Red-Black Tree

Binary Search Tree

Binary Heap Tree

Q329. ……………….. of binary search tree starts by visiting the current node’s left child, then its right child and nally the current node itself.

Preorder

In-order

Linear

Post-order

Q330. With an ideal balance, the running time for inserts, searches and deletes, even in the worst case is ………………………
https://admin.myslate.sixphrase.com/test/preview?test_id=1444a088-f636-4422-8f78-3da9616763a5&branch_id=331ab009-cfbf-44c0-b68b-8d6bc1103e93&isprint=true 84/136
6/24/2019 Six Phrase - mySlate

log2n

log2(n+1)

n+1

Q331. In binary search tree, a …………………… rooted to node n is the tree formed by imaging node n was a root.

cycle

node

root

subtree

Q332. …………………………… is a binary search tree whose left subtree and right subtree differ in height by at most 1 unit and whose left and
right subtrees are themselves AVL trees.

Red-Black Tree

AVL Tree

Binary Head Tree

A-A Tree

Q333. ………………… is a binary search tree whose leaves are external nodes.

Red-Black Tree

AVL Tree

Binary Heap Tree

A-A Tree

Q334. Which of the following is/are properties of red-black tree.


i) every node is either red or black ii) the root is red iii) If a node is red, then both its children are black iv) every leaf is black

https://admin.myslate.sixphrase.com/test/preview?test_id=1444a088-f636-4422-8f78-3da9616763a5&branch_id=331ab009-cfbf-44c0-b68b-8d6bc1103e93&isprint=true 85/136
6/24/2019 Six Phrase - mySlate

i, ii and iii only

i, iii and iv only

i, ii and iv only

All i, ii, iii and iv

Q335.
While inserting into ………………………….., insertions are done at a leaf and will replace an external node with an internal node with two
external children.

red-black tree

AVL tree

binary search tree

binary heap tree

Q336. For an AVL tree ………………………….. is the additional piece of information which indicates if the difference in height between the left
and right subtree is the same or if not, which of the two subtrees has height one unit larger.

tree factor

balance factor

additional factor

unit factor

Q337. ………………… is a complete binary tree, that is completely lled except possibly at the bottom level.

Red-Black Tree

AVL Tree

Binary Heap Tree

A-A Tree

Q338. In a …………………….. for every node X with a parent P, the key in P is less than or equal to the key in X.

red-black

AVL

https://admin.myslate.sixphrase.com/test/preview?test_id=1444a088-f636-4422-8f78-3da9616763a5&branch_id=331ab009-cfbf-44c0-b68b-8d6bc1103e93&isprint=true 86/136
6/24/2019 Six Phrase - mySlate

binary search

binary heap

Q339. An insertion into a ……………………….. is performed by inserting the new node in the location referenced by next in the array and then
“sifting it up” by comparing the key of the newly inserted node with the key of the parent.

red-black

AVL

binary search

binary heap

Q340. While deleting nodes from a binary heap, …………………. node is replaced by the last leaf in the tree.

left leaf

right leaf

root

cycle

Q341. In which of the following tree, parent node has a key value greater than or equal to the key value of both of its children?

Binary search tree

Threaded binary tree

Complete binary tree

Max-heap

Q342. A binary search tree is generated by inserting in order the following integers:
50, 15, 62, 5, 20, 58, 91, 3, 8, 37, 60, 24

The number of the node in the left sub-tree and right sub-tree of the root, respectively, is

(4, 7)

(7, 4)

(8, 3)

https://admin.myslate.sixphrase.com/test/preview?test_id=1444a088-f636-4422-8f78-3da9616763a5&branch_id=331ab009-cfbf-44c0-b68b-8d6bc1103e93&isprint=true 87/136
6/24/2019 Six Phrase - mySlate

(3, 8)

Q343. What is a full binary tree?

Each node has exactly zero or two children

Each node has exactly two children

All the leaves are at the same level

Each node has exactly one or two children

Q344. What is a complete binary tree?

Each node has exactly zero or two children

A binary tree, which is completely lled, with the possible exception of the
bottom level, which is lled from right to left

A binary tree, which is completely lled, with the possible exception of the
bottom level, which is lled from left to right

None of the mentioned

Q345. What is the maximum height of any AVL tree with 7 nodes? Assume that height of tree with single node is 0.

Q346. The height of a tree is the length of the longest root-to-leaf path in it. The maximum and minimum number of nodes in a binary tree
of height 5 are

63 and 6, respectively 

64 and 5, respectively

32 and 6, respectively

31 and 5, respectively

Q347. Suppose you are given a binary tree with n nodes, such that each node has exactly either zero or two children. The maximum height
of the tree will be
 
https://admin.myslate.sixphrase.com/test/preview?test_id=1444a088-f636-4422-8f78-3da9616763a5&branch_id=331ab009-cfbf-44c0-b68b-8d6bc1103e93&isprint=true 88/136
6/24/2019 Six Phrase - mySlate

n/2-1

n/2+1

(n – 1) / 2 

(n + 1) / 2

Q348. The height of a binary tree is the maximum number of edges in any root to leaf path. The maximum number of nodes in a binary
tree of height h is:
 

2^h-1

2^(h-1) -1

2^(h+1)-1 

2*(h+1)

Q349. The number of leaf nodes in a rooted tree of n nodes, with each node having 0 or 3 children is:
 

n/2

(n-1)/3

(n-1)/2

(2n+1)/3 

Q350. Level of a node is distance from root to that node. For example, level of root is 1 and levels of left and right children of root is 2. The
maximum number of nodes on level i of a binary tree is 
 
In the following answers, the operator '^' indicates power.

2^(i)-1 

2^i

2^(i+1)

2^[(i+1)/2]

Q351. How will you nd the minimum element in a binary search tree? 

https://admin.myslate.sixphrase.com/test/preview?test_id=1444a088-f636-4422-8f78-3da9616763a5&branch_id=331ab009-cfbf-44c0-b68b-8d6bc1103e93&isprint=true 89/136
6/24/2019 Six Phrase - mySlate

public void min(Tree root)


{
      while(root.left() != null)
      {
            root = root.left();
      }
      System.out.println(root.data());
}

public void min(Tree root)


{
      while(root != null)
      {
            root = root.left();
      }
      System.out.println(root.data());
}

public void min(Tree root)


{
      while(root.right() != null)
      {
            root = root.right();
      }
      System.out.println(root.data());
}

public void min(Tree root)


{
      while(root != null)
      {
            root = root.right();
      }
      System.out.println(root.data());
}

Q352.  Select the code snippet which performs in-order traversal.

public void inorder(Tree root)


{
System.out.println(root.data);
inorder(root.left);
inorder(root.right);
}

public void inorder(Tree root)


{
inorder(root.left);
System.out.println(root.data);
inorder(root.right);
}

https://admin.myslate.sixphrase.com/test/preview?test_id=1444a088-f636-4422-8f78-3da9616763a5&branch_id=331ab009-cfbf-44c0-b68b-8d6bc1103e93&isprint=true 90/136
6/24/2019 Six Phrase - mySlate

public void inorder(Tree root)


{
System.out.println(root.data);
inorder(root.right);
inorder(root.left);
}

None of the mentioned

Q353. The Data structure used in standard implementation of Breadth First Search is?

Stack 

Queue

Linked List

None of the mentioned

Q354. A person wants to visit some places. He starts from a vertex and then wants to visit every place connected to this vertex and so on.
What algorithm he should use?

Depth First Search

Breadth First Search

Trim’s algorithm

None of the mentioned

Q355.
Given an empty AVL tree, how would you construct AVL tree when a set of numbers are given without performing any rotations? 

just build the tree with the given input 

nd the median of the set of elements given, make it as root and construct
the tree 

use trial and error 

use dynamic programming to build the tree 

Q356. In linked list implementation of a queue, from where is the item deleted? 
https://admin.myslate.sixphrase.com/test/preview?test_id=1444a088-f636-4422-8f78-3da9616763a5&branch_id=331ab009-cfbf-44c0-b68b-8d6bc1103e93&isprint=true 91/136
6/24/2019 Six Phrase - mySlate

At the head of link list 

At the centre position in the link list 

At the tail of the link list 

None of the mentioned 

Q357. Spooling :

a.holds a copy of the data

b.is fast memory

c.holds the only copy of the data

d.holds output for a device

https://admin.myslate.sixphrase.com/test/preview?test_id=1444a088-f636-4422-8f78-3da9616763a5&branch_id=331ab009-cfbf-44c0-b68b-8d6bc1103e93&isprint=true 92/136
6/24/2019 Six Phrase - mySlate

Answer Key & Solution


Section 1 - Basic Programming Logic

Q1 C.Comments

Solution

No Solution

Q2 C.40

Solution

No Solution

Q3 C.32

Solution

No Solution

Q4 b.35

Solution

No Solution

Q5 d.0 to 1023

Solution

No Solution

Q6 a. a = 10 b = 200

Solution

No Solution

Q7 b. compiler

Solution

No Solution

Q8 d. Boolean

Solution

https://admin.myslate.sixphrase.com/test/preview?test_id=1444a088-f636-4422-8f78-3da9616763a5&branch_id=331ab009-cfbf-44c0-b68b-8d6bc1103e93&isprint=true 93/136
6/24/2019 Six Phrase - mySlate

No Solution

Q9 d. Stack

Solution

No Solution

Q10 a. -12

Solution

No Solution

Q11 b. Recursion

Solution

No Solution

Q12 a. 50

Solution

No Solution

Q13 d. 0 if a equals b, -1 otherwise

Solution

No Solution

Q14 b. Use functions

Solution

No Solution

Q15 a. Void pointer

Solution

No Solution

Q16 a. Function is a named code unlike method which is a part of an object

Solution
https://admin.myslate.sixphrase.com/test/preview?test_id=1444a088-f636-4422-8f78-3da9616763a5&branch_id=331ab009-cfbf-44c0-b68b-8d6bc1103e93&isprint=true 94/136
6/24/2019 Six Phrase - mySlate

No Solution

Q17 b. 40

Solution

No Solution

Q18 b. Global Variable

Solution

No Solution

Q19 a. Anonymous Function

Solution

No Solution

Q20 c. Public and No Modi er

Solution

No Solution

Q21 c. Public and No Modi er

Solution

No Solution

Q22 d.Statement 4

Solution

No Solution

Q23 b.Statement 2

Solution

No Solution

Q24 a. n equals 1

Solution

https://admin.myslate.sixphrase.com/test/preview?test_id=1444a088-f636-4422-8f78-3da9616763a5&branch_id=331ab009-cfbf-44c0-b68b-8d6bc1103e93&isprint=true 95/136
6/24/2019 Six Phrase - mySlate

No Solution

Q25 d.return n*factorial(n-1)

Solution

No Solution

Q26 a) -1

Solution

No Solution

Q27 b) FILE is a structure and fp is a pointer to the structure of FILE type

Solution

No Solution

Q28 a) A character string containing the name of the le & the second argument is the mode

Solution

No Solution

Q29 c) NULL

Solution

No Solution

Q30 c) In rewind, there is no way to check if the operations completed successfully

Solution

No Solution

Q31 c) struct type

Solution

No Solution

Q32 d) It is a type name de ned in stdio.h

Solution

https://admin.myslate.sixphrase.com/test/preview?test_id=1444a088-f636-4422-8f78-3da9616763a5&branch_id=331ab009-cfbf-44c0-b68b-8d6bc1103e93&isprint=true 96/136
6/24/2019 Six Phrase - mySlate

No Solution

Q33 c) Both of the above —

Solution

No Solution

Q34 b) fprintf() with FILE stream as stdout.

Solution

No Solution

Q35 b) False

Solution

No Solution

Q36 a) True

Solution

No Solution

Q37 a) Subscripted variable

Solution

No Solution

Q38 b) Garbage value

Solution

No Solution

Q39 b) Dimension

Solution

No Solution

Q40 c) program will crash

Solution

No Solution

Q41 b) 3, 2, 32
https://admin.myslate.sixphrase.com/test/preview?test_id=1444a088-f636-4422-8f78-3da9616763a5&branch_id=331ab009-cfbf-44c0-b68b-8d6bc1103e93&isprint=true 97/136
6/24/2019 Six Phrase - mySlate

Solution

No Solution

Q42 a) 65482, 65498

Solution

No Solution

Q43 a) garbage value,1,2,3,4

Solution

No Solution

Q44 a) 16 bytes, 4 bytes

Solution

No Solution

Q45 c) int fun(int arr[2])

Solution

No Solution

Q46 a) second

Solution

No Solution

Q47 c) Call by reference by passing base address to a function

Solution

No Solution

Q48 a) Compile Time Error

Solution

No Solution

Q49 a) int main(int var, char *argv[])

Solution

No Solution
https://admin.myslate.sixphrase.com/test/preview?test_id=1444a088-f636-4422-8f78-3da9616763a5&branch_id=331ab009-cfbf-44c0-b68b-8d6bc1103e93&isprint=true 98/136
6/24/2019 Six Phrase - mySlate

Q50 b) argument count, argument vector

Solution

No Solution

Q51 b) Jagged Array

Solution

No Solution

Q52 a)May vary from one OS to another

Solution

No Solution

Q53 c) argc – 1

Solution

No Solution

Q54 a)File Name

Solution

No Solution

Q55 c)Array of character pointers

Solution

No Solution

Q56 a)Error

Solution

No Solution

Q57 b) File Name and pointer to rst command line argument supplied.

Solution

No Solution

Q58 d) Number of Arguments + 1

https://admin.myslate.sixphrase.com/test/preview?test_id=1444a088-f636-4422-8f78-3da9616763a5&branch_id=331ab009-cfbf-44c0-b68b-8d6bc1103e93&isprint=true 99/136
6/24/2019 Six Phrase - mySlate

Solution

No Solution

Q59 d) In nte Loop

Solution

No Solution

Q60 b) o

Solution

No Solution

Q61 a) r

Solution

No Solution

Q62 b) Compile time error

Solution

No Solution

Q63 d) hello hello

Solution

No Solution

Q64 a) return

Solution

No Solution

Q65 d) All of the mentioned

Solution

No Solution

Q66 c) double

Solution

No Solution
https://admin.myslate.sixphrase.com/test/preview?test_id=1444a088-f636-4422-8f78-3da9616763a5&branch_id=331ab009-cfbf-44c0-b68b-8d6bc1103e93&isprint=true 100/136
6/24/2019 Six Phrase - mySlate

Q67 d) Compile time error

Solution

No Solution

Q68 a) hello 5

Solution

No Solution

Q69 a) 5

Solution

No Solution

Q70 B. prints “C-Program” in netly

Solution

No Solution

Q71 D. Till stack over ows

Solution

No Solution

Q72 d.Error

Solution

No Solution

Q73 c.Do While Loop

Solution

No Solution

Q74 a.Decision-Making

Solution

No Solution

Q75 b.Code B will execute faster than Code A

https://admin.myslate.sixphrase.com/test/preview?test_id=1444a088-f636-4422-8f78-3da9616763a5&branch_id=331ab009-cfbf-44c0-b68b-8d6bc1103e93&isprint=true 101/136
6/24/2019 Six Phrase - mySlate

Solution

No Solution

Q76 a.Differ by 80

Solution

No Solution

Q77 c.Do While Loop

Solution

No Solution

Q78 b.411

Solution

No Solution

Q79 a.Decision-Making

Solution

No Solution

Q80 d.This code will generate an error

Solution

No Solution

Q81 a) 0

Solution

No Solution

Q82 a) true

Solution

No Solution

Q83 b) Garbage Value

Solution

No Solution
https://admin.myslate.sixphrase.com/test/preview?test_id=1444a088-f636-4422-8f78-3da9616763a5&branch_id=331ab009-cfbf-44c0-b68b-8d6bc1103e93&isprint=true 102/136
6/24/2019 Six Phrase - mySlate

Q84 a) 9

Solution

No Solution

Q85 d) Within the block it appears & Within the blocks of the block it appears

Solution

No Solution

Q86 a) stack

Solution

No Solution

Q87 c) auto

Solution

No Solution

Q88 a) stack

Solution

No Solution

Q89 d) Compile time error

Solution

No Solution

Q90 b) false

Solution

No Solution

Q91 b) registers

Solution

No Solution

Q92 d) All of the mentioned

https://admin.myslate.sixphrase.com/test/preview?test_id=1444a088-f636-4422-8f78-3da9616763a5&branch_id=331ab009-cfbf-44c0-b68b-8d6bc1103e93&isprint=true 103/136
6/24/2019 Six Phrase - mySlate

Solution

No Solution

Q93 b) World

Solution

No Solution

Q94 b) It will throw an error

Solution

No Solution

Q95 d) hihello

Solution

No Solution

Q96 a) break

Solution

No Solution

Q97 b) for (i = 0, j = 0;i < n, j < n; i++, j += 5)

Solution

No Solution

Q98 d) for (i = n-1; i>-1; i–)

Solution

No Solution

Q99 a) Compile time error

Solution

No Solution

Q100 b) Hello is printed thrice

Solution

https://admin.myslate.sixphrase.com/test/preview?test_id=1444a088-f636-4422-8f78-3da9616763a5&branch_id=331ab009-cfbf-44c0-b68b-8d6bc1103e93&isprint=true 104/136
6/24/2019 Six Phrase - mySlate

No Solution

Q101 b) Inside while loop

Outside loop

Solution

No Solution

Q102  a) Inside while loop Inside while loop Inside while loop

Solution

No Solution

Q103  d) macros

Solution

No Solution

Q104 b) return

Solution

No Solution

Q105  b) if-else

Solution

No Solution

Q106  b) continue

Solution

No Solution

Q107 d) Compile time error

Solution

No Solution

Q108 d) None

https://admin.myslate.sixphrase.com/test/preview?test_id=1444a088-f636-4422-8f78-3da9616763a5&branch_id=331ab009-cfbf-44c0-b68b-8d6bc1103e93&isprint=true 105/136
6/24/2019 Six Phrase - mySlate

Solution

No Solution

Q109 c) int 1_v;

Solution

No Solution

Q110 c) To avoid con icts since library routines use such names

Solution

No Solution

Q111 d) int $main;

Solution

No Solution

Q112 c) run without any error and prints 5

Solution

No Solution

Q113 c) volatile

Solution

No Solution

Q114 d) int

Solution

No Solution

Q115 d) all of the mentioned

Solution

No Solution

Q116
https://admin.myslate.sixphrase.com/test/preview?test_id=1444a088-f636-4422-8f78-3da9616763a5&branch_id=331ab009-cfbf-44c0-b68b-8d6bc1103e93&isprint=true 106/136
6/24/2019 Six Phrase - mySlate
c) short is the quali er and int is the basic datatype

Solution

No Solution

Q117 b) -128

Solution

No Solution

Q118 c) Depends on the system/compiler

Solution

No Solution

Q119 b) struct

Solution

No Solution

Q120 a) 97.000000

Solution

No Solution

Q121 b.By making at least one member function as pure virtual function.

Solution

No Solution

Q122 b.By making at least one member function as pure virtual function.

Solution

No Solution

Q123 c.Singleton class

Solution

No Solution

Q124 d.Data binding

Solution

https://admin.myslate.sixphrase.com/test/preview?test_id=1444a088-f636-4422-8f78-3da9616763a5&branch_id=331ab009-cfbf-44c0-b68b-8d6bc1103e93&isprint=true 107/136
6/24/2019 Six Phrase - mySlate

No Solution

Q125 d.All of the above

Solution

No Solution

Q126 b.Static function

Solution

No Solution

Q127 c.Protected data members

Solution

No Solution

Q128 c.Distributive

Solution

No Solution

Q129 c.Inheritance

Solution

No Solution

Q130 d.Inheritance

Solution

No Solution

Q131 a.extends

Solution

No Solution

Q132 a.expansion bus

Solution

https://admin.myslate.sixphrase.com/test/preview?test_id=1444a088-f636-4422-8f78-3da9616763a5&branch_id=331ab009-cfbf-44c0-b68b-8d6bc1103e93&isprint=true 108/136
6/24/2019 Six Phrase - mySlate

No Solution

Q133 c.device drivers

Solution

No Solution

Q134 b.daisy chain

Solution

No Solution

Q135 c.interrupt handler

Solution

No Solution

Q136 c.data in

Solution

No Solution

Q137 d.data out

Solution

No Solution

Q138 a.interrupt request line

Solution

No Solution

Q139 a.non-maskable interrupts

Solution

No Solution

Q140 b.interrupt

Solution

No Solution

https://admin.myslate.sixphrase.com/test/preview?test_id=1444a088-f636-4422-8f78-3da9616763a5&branch_id=331ab009-cfbf-44c0-b68b-8d6bc1103e93&isprint=true 109/136
6/24/2019 Six Phrase - mySlate
Q141 b.imperative polymorphism

Solution

No Solution

Q142 b.Overriding

Solution

No Solution

Q143 b.There might be two or more functions with the same name

Solution

No Solution

Q144 d.Heap

Solution

No Solution

Q145 c.Ad-hoc polymorphism

Solution

No Solution

Q146 d.*

Solution

No Solution

Q147 d.All of the above

Solution

No Solution

Q148 b.Operator

Solution

No Solution
https://admin.myslate.sixphrase.com/test/preview?test_id=1444a088-f636-4422-8f78-3da9616763a5&branch_id=331ab009-cfbf-44c0-b68b-8d6bc1103e93&isprint=true 110/136
6/24/2019 Six Phrase - mySlate
Q149 c.can be both (A) & (B) above

Solution

No Solution

Q150 B) continue

Solution

No Solution

Q151 B) rand()

Solution

No Solution

Q152 B. double

Solution

No Solution

Q153 B) It will run forever

Solution

No Solution

Q154 A) 2 or 4

Solution

No Solution

Q155 B) 20

Solution

No Solution

Q156 A) Error

Solution

No Solution

Q157 D) printf(“%ld\n”,fact(5));

Solution

https://admin.myslate.sixphrase.com/test/preview?test_id=1444a088-f636-4422-8f78-3da9616763a5&branch_id=331ab009-cfbf-44c0-b68b-8d6bc1103e93&isprint=true 111/136
6/24/2019 Six Phrase - mySlate

No Solution

Q158 A) int

Solution

No Solution

Q159 A) 5

Solution

No Solution

Q160 c) 15

Solution

No Solution

Q161 b)convert a character string to its equivalent integer value

Solution

No Solution

Q162 c) strptr()

Solution

No Solution

Q163 a) and()

Solution

No Solution

Q164 b) In stack Memory

Solution

No Solution

Q165 d) char * argv[]

Solution

No Solution

https://admin.myslate.sixphrase.com/test/preview?test_id=1444a088-f636-4422-8f78-3da9616763a5&branch_id=331ab009-cfbf-44c0-b68b-8d6bc1103e93&isprint=true 112/136
6/24/2019 Six Phrase - mySlate
Q166 a) a program allocates memory in heap but forgets to be allocate it

Solution

No Solution

Q167 3. All of these

Solution

No Solution

Q168 4. Passed to a function as argument

Solution

No Solution

Q169 3. \0

Solution

No Solution

Q170 2. Structure

Solution

No Solution

Q171 c) Both feof() and EOF

Solution

No Solution

Q172 a) int

Solution

No Solution

Q173 b) Stack

Solution

No Solution

Q174 d) 5

https://admin.myslate.sixphrase.com/test/preview?test_id=1444a088-f636-4422-8f78-3da9616763a5&branch_id=331ab009-cfbf-44c0-b68b-8d6bc1103e93&isprint=true 113/136
6/24/2019 Six Phrase - mySlate

Solution

No Solution

Q175 a) points to garbage value

Solution

No Solution

Q176 a)to get the current le position

Solution

No Solution

Q177 d) function calls itself repeatedly

Solution

No Solution

Q178 b) can create new data types

Solution

No Solution

Q179 a) Enum

Solution

No Solution

Q180 b) Runtime error

Solution

No Solution

Q181 1. free();

Solution

No Solution

Q182 3. math.h

https://admin.myslate.sixphrase.com/test/preview?test_id=1444a088-f636-4422-8f78-3da9616763a5&branch_id=331ab009-cfbf-44c0-b68b-8d6bc1103e93&isprint=true 114/136
6/24/2019 Six Phrase - mySlate

Solution

No Solution

Q183 3. Pointer to pointer

Solution

No Solution

Q184 1. (underscore)

Solution

No Solution

Q185 3. Lowercase letters

Solution

No Solution

Q186 1. hello_World

Solution

No Solution

Q187 d) Compile time error

Solution

No Solution

Q188 d) stdout is line buffered but stderr is unbuffered.

Solution

No Solution

Q189 C) 1,2,3

Solution

No Solution

Q190
https://admin.myslate.sixphrase.com/test/preview?test_id=1444a088-f636-4422-8f78-3da9616763a5&branch_id=331ab009-cfbf-44c0-b68b-8d6bc1103e93&isprint=true 115/136
6/24/2019 Six Phrase - mySlate
C) It should be called only within the same source code/program le.

Solution

No Solution

Q191 c) Both calloc & malloc 

Solution

No Solution

Q192 b) int 

Solution

No Solution

Q193 c) Heap area

Solution

No Solution

Q194 c) 1 Byte

Solution

No Solution

Q195 c) unsigned int

Solution

No Solution

Q196 c) free(p);

Solution

No Solution

Q197 a) x is 97 

Solution

No Solution

Q198 B) char* argv[]

https://admin.myslate.sixphrase.com/test/preview?test_id=1444a088-f636-4422-8f78-3da9616763a5&branch_id=331ab009-cfbf-44c0-b68b-8d6bc1103e93&isprint=true 116/136
6/24/2019 Six Phrase - mySlate

Solution

No Solution

Q199 C) strupr

Solution

No Solution

Q200 A) Expanding

Solution

No Solution

Q201 B) Unary operator works on only one operand

Solution

No Solution

Q202 AVL tree

Solution

No Solution

Q203 rst node of left sub tree

Solution

No Solution

Q204 Heaps

Solution

No Solution

Q205 Both a and c

Solution

No Solution

Q206 left sub tree-> root->right sub tree

Solution

https://admin.myslate.sixphrase.com/test/preview?test_id=1444a088-f636-4422-8f78-3da9616763a5&branch_id=331ab009-cfbf-44c0-b68b-8d6bc1103e93&isprint=true 117/136
6/24/2019 Six Phrase - mySlate

No Solution

Q207 O(1)

Solution

No Solution

Q208 Both a and b

Solution

No Solution

Q209 0, 0.000000

Solution

No Solution

Q210 d) All of the mentioned

Solution

No Solution

Q211 20

Solution

No Solution

Q212 1

Solution

No Solution

Q213 The for loop would get executed in nite times

Solution

No Solution

Q214 display() is called before it is de ned

Solution

No Solution

Q215  Error: Declaration syntax error 'v' (or) Size of v is unknown or zero.
https://admin.myslate.sixphrase.com/test/preview?test_id=1444a088-f636-4422-8f78-3da9616763a5&branch_id=331ab009-cfbf-44c0-b68b-8d6bc1103e93&isprint=true 118/136
6/24/2019 Six Phrase - mySlate

Solution

No Solution

Q216 It is a typedef for enum error.

Solution

No Solution

Q217 6.68L

Solution

No Solution

Q218 Stack

Solution

No Solution

Q219 6

Solution

No Solution

Q220 Stack over ow

Solution

No Solution

Q221 22

Solution

No Solution

Q222 24

Solution

No Solution

Q223 24

Solution

No Solution
https://admin.myslate.sixphrase.com/test/preview?test_id=1444a088-f636-4422-8f78-3da9616763a5&branch_id=331ab009-cfbf-44c0-b68b-8d6bc1103e93&isprint=true 119/136
6/24/2019 Six Phrase - mySlate

Q224 0011

Solution

No Solution

Q225 36

Solution

No Solution

Q226 (n + 1)/2

Solution

No Solution

Q227 O(n)

Solution

No Solution

Q228 Linear time

Solution

No Solution

Q229 (n+1)/2

Solution

No Solution

Q230 For a serial search to work, the data in the array must be arranged in either alphabetical or numerical order

Solution

No Solution

Q231 binary 

Solution

No Solution

Q232 Merge sort

Solution

https://admin.myslate.sixphrase.com/test/preview?test_id=1444a088-f636-4422-8f78-3da9616763a5&branch_id=331ab009-cfbf-44c0-b68b-8d6bc1103e93&isprint=true 120/136
6/24/2019 Six Phrase - mySlate

No Solution

Q233 O(n)

Solution

No Solution

Q234 O(1),O(n) and O(n)

Solution

No Solution

Q235 O(n)

Solution

No Solution

Q236 AVL tree

Solution

No Solution

Q237 root

Solution

No Solution

Q238 Hash tables

Solution

No Solution

Q239 nodes

Solution

No Solution

Q240 Both a and c

Solution

No Solution

Q241 left sub tree-> root->right sub tree


https://admin.myslate.sixphrase.com/test/preview?test_id=1444a088-f636-4422-8f78-3da9616763a5&branch_id=331ab009-cfbf-44c0-b68b-8d6bc1103e93&isprint=true 121/136
6/24/2019 Six Phrase - mySlate

Solution

No Solution

Q242 O(1)

Solution

No Solution

Q243 Accessing elements at speci ed positions 

Solution

No Solution

Q244 both a and b

Solution

No Solution

Q245 All of the above

Solution

No Solution

Q246 for relatively permanent collections of data.

Solution

No Solution

Q247 for the size of the structure and the data in the structure are constantly changing.

Solution

No Solution

Q248  address of the next node

Solution

No Solution

Q249 Linked list

Solution

No Solution
https://admin.myslate.sixphrase.com/test/preview?test_id=1444a088-f636-4422-8f78-3da9616763a5&branch_id=331ab009-cfbf-44c0-b68b-8d6bc1103e93&isprint=true 122/136
6/24/2019 Six Phrase - mySlate

Q250 Pointer to integer

Solution

No Solution

Q251 Data and Link

Solution

No Solution

Q252 All of the mentioned

Solution

No Solution

Q253 Space Utilization and Computational Time

Solution

No Solution

Q254 traversal

Solution

No Solution

Q255 rst record of the actual data

Solution

No Solution

Q256 Sentinel

Solution

No Solution

Q257 small batches of records from a le

Solution

No Solution

Q258 singly linked list

Solution

https://admin.myslate.sixphrase.com/test/preview?test_id=1444a088-f636-4422-8f78-3da9616763a5&branch_id=331ab009-cfbf-44c0-b68b-8d6bc1103e93&isprint=true 123/136
6/24/2019 Six Phrase - mySlate

No Solution

Q259  Lists implemented with an array.

Solution

No Solution

Q260 all the above

Solution

No Solution

Q261 pointer-variable=(struct-name*)malloc(sizeof(struct-name)); 

Solution

No Solution

Q262 ptr = (NODE*)malloc(sizeof(NODE));

Solution

No Solution

Q263 Dynamic

Solution

No Solution

Q264 Garbage collection

Solution

No Solution

Q265  The results are unpredictable.

Solution

No Solution

Q266  Delete the last element of the list

Solution

No Solution

https://admin.myslate.sixphrase.com/test/preview?test_id=1444a088-f636-4422-8f78-3da9616763a5&branch_id=331ab009-cfbf-44c0-b68b-8d6bc1103e93&isprint=true 124/136
6/24/2019 Six Phrase - mySlate
Q267 I and III

Solution

No Solution

Q268 Prints all nodes of linked list in reverse order

Solution

No Solution

Q269 p= current->next->next;free(current->next);current->next = p; 

Solution

No Solution

Q270 Deletes all nodes 

Solution

No Solution

Q271 The number of elements in a linked list 

Solution

No Solution

Q272 135531

Solution

No Solution

Q273 Structure declaration

Solution

No Solution

Q274 Adds new data to list

Solution

No Solution

Q275 Adds new data to list

Solution

https://admin.myslate.sixphrase.com/test/preview?test_id=1444a088-f636-4422-8f78-3da9616763a5&branch_id=331ab009-cfbf-44c0-b68b-8d6bc1103e93&isprint=true 125/136
6/24/2019 Six Phrase - mySlate

No Solution

Q276 structure declaration for DLL 

Solution

No Solution

Q277  X -> bwd -> fwd = X -> fwd; X -> fwd -> bwd = X -> bwd

Solution

No Solution

Q278  start = X -> fwd; start -> bwd = NULL;

Solution

No Solution

Q279 This could be a node in a doubly linked list 

Solution

No Solution

Q280 List traversed in two directions

Solution

No Solution

Q281 The function is implemented incorrectly because it changes head 

Solution

No Solution

Q282 Add new data into a list in DLL

Solution

No Solution

Q283 Delete data from a list in DLL

Solution

https://admin.myslate.sixphrase.com/test/preview?test_id=1444a088-f636-4422-8f78-3da9616763a5&branch_id=331ab009-cfbf-44c0-b68b-8d6bc1103e93&isprint=true 126/136
6/24/2019 Six Phrase - mySlate

No Solution

Q284 Create

Solution

No Solution

Q285 Pop

Solution

No Solution

Q286 Over ow

Solution

No Solution

Q287 Under ow

Solution

No Solution

Q288 There is a Sequential entry that is one by one

Solution

No Solution

Q289 A parentheses balancing program

Solution

No Solution

Q290 Job scheduling

Solution

No Solution

Q291 Stack is the FIFO data structure

Solution

No Solution

Q292 First node


https://admin.myslate.sixphrase.com/test/preview?test_id=1444a088-f636-4422-8f78-3da9616763a5&branch_id=331ab009-cfbf-44c0-b68b-8d6bc1103e93&isprint=true 127/136
6/24/2019 Six Phrase - mySlate

Solution

No Solution

Q293 1

Solution

No Solution

Q294 DCBA

Solution

No Solution

Q295 Stack

Solution

No Solution

Q296 Stack

Solution

No Solution

Q297 Stack

Solution

No Solution

Q298 Post x Expression

Solution

No Solution

Q299 AB*CD/+

Solution

No Solution

Q300 xyz*+pq*r+s*+

Solution

No Solution
https://admin.myslate.sixphrase.com/test/preview?test_id=1444a088-f636-4422-8f78-3da9616763a5&branch_id=331ab009-cfbf-44c0-b68b-8d6bc1103e93&isprint=true 128/136
6/24/2019 Six Phrase - mySlate

Q301 ABD^+EF–/G+

Solution

No Solution

Q302 abc X+ def ^^ –

Solution

No Solution

Q303 AB + CD* E – *F *G /

Solution

No Solution

Q304 -A/B*C^DE

Solution

No Solution

Q305 + p-q*rt

Solution

No Solution

Q306 350

Solution

No Solution

Q307 3

Solution

No Solution

Q308 front = 2 rear = 5

queue = ______; L, M, N, O, ___

Solution

No Solution

Q309 Queue 

https://admin.myslate.sixphrase.com/test/preview?test_id=1444a088-f636-4422-8f78-3da9616763a5&branch_id=331ab009-cfbf-44c0-b68b-8d6bc1103e93&isprint=true 129/136
6/24/2019 Six Phrase - mySlate

Solution

No Solution

Q310 FIFO (First In First Out) list 

Solution

No Solution

Q311 rear=(rear+1)%MAX_SIZE

Solution

No Solution

Q312 Front=(rear+1)%MAX_SIZE

Solution

No Solution

Q313 0

Solution

No Solution

Q314 Front= rear=-1

Solution

No Solution

Q315 Deque

Solution

No Solution

Q316 Only rear pointer

Solution

No Solution

Q317 Rear=MAX_SIZE-1

Solution

No Solution
https://admin.myslate.sixphrase.com/test/preview?test_id=1444a088-f636-4422-8f78-3da9616763a5&branch_id=331ab009-cfbf-44c0-b68b-8d6bc1103e93&isprint=true 130/136
6/24/2019 Six Phrase - mySlate

Q318 Both front and rear pointer

Solution

No Solution

Q319 MAX_SIZE

Solution

No Solution

Q320 Full: (REAR+1)mod n == FRONT

Empty: REAR==FRONT

Solution

No Solution

Q321 Undo/Redo operations in a notepad

Solution

No Solution

Q322 binary search tree

Solution

No Solution

Q323 binary search tree

Solution

No Solution

Q324 2^(h+1) -1.

Solution

No Solution

Q325 log2n.

Solution

No Solution
https://admin.myslate.sixphrase.com/test/preview?test_id=1444a088-f636-4422-8f78-3da9616763a5&branch_id=331ab009-cfbf-44c0-b68b-8d6bc1103e93&isprint=true 131/136
6/24/2019 Six Phrase - mySlate

Q326 Preorder traversal

Solution

No Solution

Q327 Height

Solution

No Solution

Q328 Binary Search Tree

Solution

No Solution

Q329 Post-order

Solution

No Solution

Q330 log2n

Solution

No Solution

Q331 subtree

Solution

No Solution

Q332 AVL Tree

Solution

No Solution

Q333 Red-Black Tree

Solution

No Solution

Q334 i, iii and iv only

Solution

https://admin.myslate.sixphrase.com/test/preview?test_id=1444a088-f636-4422-8f78-3da9616763a5&branch_id=331ab009-cfbf-44c0-b68b-8d6bc1103e93&isprint=true 132/136
6/24/2019 Six Phrase - mySlate

No Solution

Q335 red-black tree

Solution

No Solution

Q336 balance factor

Solution

No Solution

Q337 Binary Heap Tree

Solution

No Solution

Q338 binary heap

Solution

No Solution

Q339 binary heap

Solution

No Solution

Q340 root

Solution

No Solution

Q341 Max-heap

Solution

No Solution

Q342 (7, 4)

Solution

No Solution

Q343 Each node has exactly zero or two children


https://admin.myslate.sixphrase.com/test/preview?test_id=1444a088-f636-4422-8f78-3da9616763a5&branch_id=331ab009-cfbf-44c0-b68b-8d6bc1103e93&isprint=true 133/136
6/24/2019 Six Phrase - mySlate

Solution

No Solution

Q344 A binary tree, which is completely lled, with the possible exception of the bottom level, which is lled from left to right

Solution

No Solution

Q345 3

Solution

No Solution

Q346 63 and 6, respectively 

Solution

No Solution

Q347 (n – 1) / 2 

Solution

No Solution

Q348 2^(h+1)-1 

Solution

No Solution

Q349 (2n+1)/3 

Solution

No Solution

Q350 2^(i)-1 

Solution

No Solution

Q351 public void min(Tree root)

      while(root.left() != null)

https://admin.myslate.sixphrase.com/test/preview?test_id=1444a088-f636-4422-8f78-3da9616763a5&branch_id=331ab009-cfbf-44c0-b68b-8d6bc1103e93&isprint=true 134/136
6/24/2019 Six Phrase - mySlate
      {

            root = root.left();

      }

      System.out.println(root.data());

Solution

No Solution

Q352 public void inorder(Tree root)

inorder(root.left);

System.out.println(root.data);

inorder(root.right);

Solution

No Solution

Q353 Queue

Solution

No Solution

Q354 Breadth First Search

Solution

No Solution

Q355 nd the median of the set of elements given, make it as root and construct the tree 

https://admin.myslate.sixphrase.com/test/preview?test_id=1444a088-f636-4422-8f78-3da9616763a5&branch_id=331ab009-cfbf-44c0-b68b-8d6bc1103e93&isprint=true 135/136
6/24/2019 Six Phrase - mySlate

Solution

No Solution

Q356 At the head of link list 

Solution

No Solution

Q357 c.holds the only copy of the data

d.holds output for a device

Solution

No Solution

https://admin.myslate.sixphrase.com/test/preview?test_id=1444a088-f636-4422-8f78-3da9616763a5&branch_id=331ab009-cfbf-44c0-b68b-8d6bc1103e93&isprint=true 136/136

Vous aimerez peut-être aussi