Bscit-1 Data Structure using c
Part-A
1 Mark Question
Q1. C is a programming language:-
(a) high level language
(b) middle level language
(c) low level language
(d) none the above
Q2. ?: is which type of operator?
(a) unary
(b) binary
(c) ternary
(d) none the above
Q3. What is the result of the following program:-
4*(2+2)*3
(a) 16
(b) 32
(c) 20
(d) 48
Q4. A variable which holds the memory location of the variable called:
(a) function
(b) pointer
(c) structure
(d) array
Q5. A Collection of data items of same type under unique name is called:
(a) structure
(b) array
(c) union
(d) function
Q6. ……………. is the organization of data in a file or computer’s memory
(a) array structure
(b) structure
(c) data structure
(d) all the above
Q7. Boolean is a …………data type.
(a) structured
(b) liner
(c) atomic
(d) abstract
Q8. Array is which type of data structure
(a) heterogeneous
(b) infinite
(c) unorder
(d) fixed-length
Q9. Stack is called
(a) FIFO
(b) LIFO
(c) BIFO
(d) TIFO
Q10. Queue is called
(a) FIFO
(b) LIFO
(c) BIFO
(d) TIFO
Q11. Generally In linked list each node contains
(a) 1 member
(b) 2 member
(c) 3 member
(d) 4 member
Q12. Degree of a node is calculated by
(a) subtraction of out-degree and in-degree
(b) sum of out-degree and in-degree
(c) multiplication of out-degree and in-degree
(d) None the above
Q13. A sorting is applied where the entire collection of data to be sorted is small
(a) Merge sorting
(b) Internal sorting
(c) External sorting
(d) Quick sorting
Q14. A binary search method needs no more than………… comparisons.
(a) [Log2N]+1
(b) [Log2N]-1
(c) [Log2N]
(d) [Log N]+1
Q15. What is transversal in the binary tree is
(a) to delete a node from the tree
(b) search for the specified item
(c) visiting the node of the tree one by one
(d) to obtain the exact copy of the given tree
Q16. An Empty tree is
(a) A unary tree
(b) A binary tree
(c) A tree
(d) None the above
Q17. The function is used to obtain the current position of the file pointer
(a) fseek()
(b) ftell()
(c) rewind()
(d) feof()
Q18.Which is the unformatted character I/O function?
(a) getw
(b) putw
(c) getchar
(d) getc
Q19. Structure is a collection of
(a) same data types
(b) different data types
(c) both a and b
(d) none the above
Q20. Which type of variables is initialized automatically?
(a) Automatic
(b) External
(c) Static
(d) Register
Q21. A loop that executes the statements at least once, even if the condition is fails for the first time.
(a) For
(b) While
(c) Do-while
(d) None the above
Q22. When the function call by itself is called
(a) Loop
(b) Recursion
(c) Structure
(d) Union
Q23.How many storage classes are found in C language
(a) 1
(b) 2
(c) 3
(d) 4
Q24. Members of a structure are accessed with ………. Operators
(a) .(dot)
(b) ->
(c) both a and b
(d) none
Q25. sizeof() operator returns the size of data type in
(a) bits
(b) bytes
(c) kilobytes
(d) all the above
Q26. C program should be start as …………
(a) array
(b) function
(c) structure
(d) none the above
Q27. Preprocessor directives are used in C program
(a) including files
(b) conditional compilation
(c) substitution of values
(d) all the above
Q28. Statements which are executed before the program complied is called
(a) comments
(b) preprocessor directives
(c) conditional statements
(d) none the above
Q29. The function which returns the keying in characters in the screen is
(a) getch()
(b) getche()
(c) getchar()
(d) clrscr()
Q30. A directed tee is
(a) Bi-cyclic
(b) acyclic
(c) cyclic
(d) All the above
Part-B
2 Mark Question
Q31. Which is not the advantage of Pointers?
(a) pointers are pointing to different data types and structures
(b) to return single value via function
(c) to achieve a clarity and simplicity
(d) to return multiple value via function
Q32. Which is not the characteristic of abstract data type?
(a) it is export type
(b) it is import type
(c) axioms and preconditions define the application domain of the type
(d) it import a set of operations
Q33. A good hash function:
(a) It is cheap to evaluate
(b) Tends to use all position from O..M with uniform frequency
(c) Tends to put similar keys in different parts of the tables
(d) All the above
Q34. Application of stack is
(a) Recursion
(b) Evaluation of expression
(c) Conversions of expressions
(d) All the above
Q35. Which is the post-order transversal of a binary tree is
(a) L->R->N
(b) R->L->N
(c) L->R->N
(d) N->L>R
Q36. Pointers are used with
(a) function name
(b) array subscript variable
(c) basic data type variable
(d) all the above
Q37. What is the output of following program?
main()
{
int *x,y;
y=12;
x=&y;
printf(“Value of x=%d”,x);
printf(“Value of y=%d”,y);
}
(a) 12,12
(b) 12,0
(c) 0,12
(d) 0,0
Q38. Which statement is true about the variable?
(a) Automatic, External and Static variable, With the same name local variables given high precedence
(b) Automatic, Local and Static variable, With the same name external variables given high precedence
(c) Automatic ,External and Local variable ,With the same name static variables given high precedence
(d) Local ,External and Static variable ,With the same name automatic variables given high precedence
Q39. Which statement is a conditional multiple branching statement.
(a) Break
(b) Continue
(c) Switch
(d) goto
Q40. Which statements are true?
1. The array range starts from zero up to specified final value
2. Subscript range must be –ve integer constant
1. Both are true
2. 1 is true
3. 2 is true
4. Both are false
Q41. Which is not a liner data structure?
(a) array
(b) tree
(c) linked list
(d) queue
Q42. Which is not an internal sort?
(a) insertion sort
(b) quick sort
(c) heap sort
(d) merge sort
Q43. Which statements are true?
1. C is a structured programming language
2. C supports poor set of data types
3. C is unstructured programming language
4. C supports rich set of data types
Answer:
(a) 1,2
(b) 1,3,4
(c) 1,4
(d) 1,2,3
Q44. What is the result of the following program?
int a=10;
x=++a + a++;
(a) 21
(b) 22
(c) 20
(d) error
Q45. Q75. What is the result of the following program?
main()
{
int a;
a=0;
while(a<10);
{
printf(“\nValue is %d”,a);
a++;
}
getch();
}
(a) It will print 0-10 values
(b) It will print 0-9 values
(c) Give error
(d) No result
Part-C
4 Mark Question
Q46. Match the following
Match-1
(a) Ordinary queue
(b) Double ended queue
(c) Circular queue
Match-2
1. item inserted from one end and deleted from another end
2. insertion and deletion will be done either at front end or rear end
3. item inserted from the rear end
Answer:
(a) 1-a,2-b,3-c
(b) 1-b,2-a,3-c
(c) 1-a,2-c,3-b
(d) 1-b,2-c,3-b
Q47. Match the following
Match-1
(a) Merge sort
(b) Heap sort
(c) Insertion sort
Match-2
1. Priority method
2. Divided-and-conquer method
3. Insertion method
(a) 1-a,2-b,3-c
(b) 1-a,2-c, 3-b
(c) 1-b,2-a,3-c
(d) 1-c,2-b,3-a
Q48. Match the following
Match-1
(a) Distribution
(b) Insertion
(c) Selection
(d) Exchange
(e) Merging
Match-2
1. putting an element in the appropriate place in a sorted list
2. rearrange pairs of elements which are out of order
3. extract the largest element form the list, remove it and repeat
4. separate into piles based on the first letter, then sort each pile
5. two sorted lists can be easily combined to form a sorted list
(a) 1-a,2-b,3-c,4-d,5-e
(b) 1-a,2-d,3-e,4-b,5-c
(c) 1-b,2-d,3-c,4-a,5-e
(d) 1-d,2-b,3-a,4-e,5-c
Q49.
Depth of the above tree is
(a) 1
(b) 2
(c) 3
(d) 4
Q50. Level of the node 80 is in the above tree is
(a) 1
(b) 2
(c) 3
(d) 4
Q51. Match the following
Match-1
(a) linked list
(b) circular list
(c) doubly linked list
Match-2
1) A linked list in which the last node points to the first node
2) A list implemented by a set of nodes, each of which points to the next.
3) A list in which each node points to the next node and previous node
Answer:
(a) 1-a,2-b,3-c
(b) 1-b,2-c,3-a
(c) 1-b,2-a,3-c
(d) 1-c,2-a,3-b
Q52.
The preorder transversal of the above binary tree is
(a) 50,20,90,80,30,40,75
(b) 80,20,40,30,75,50,90
(c) 80,40,75,30,20,90,50
(d) 50,20,80,30,40.75,90
Q53. Which statements are true about the W+ mode in the file handling?
1. opened for read and write, and the file contents are lost if file exists
2. opened for read , and the file contents are lost if file exists
3. if the file doesn’t exist, the file is read write and file pointer points to beginning of file
4. if the file doesn’t exist, the file is read write and file pointer points to end of file
Answers:-
(a) 1,3
(b) 1,2,3,4
(c) 1,4
(d) 1,2,3
Q54. Match the following
Match-1
(a) &
(b) *
(c) ->
(d) ::
Match-2
1. Scope resolution operator
2. Address of operator
3. Indirection operator
4. Membership operator
(a) 1-a,2-b,3-c,4-d
(b) 1-b,2-a,3-d,4-c
(c) 1-d,2-a,3-b,4-c
(d) 1-d,2-a,3-c,4-b
Q55. Arrange the following operators in their respective precedence
1. ()
2. %
3. <=
4. &
Answer:
(a) 1,2,3,4
(b) 1,3,2,4
(c) 1,4,3,2
(d) 1,4,2,3
1 Mark Question
Q1. C is a programming language:-
(a) high level language
(b) middle level language
(c) low level language
(d) none the above
Q2. ?: is which type of operator?
(a) unary
(b) binary
(c) ternary
(d) none the above
Q3. What is the result of the following program:-
4*(2+2)*3
(a) 16
(b) 32
(c) 20
(d) 48
Q4. A variable which holds the memory location of the variable called:
(a) function
(b) pointer
(c) structure
(d) array
Q5. A Collection of data items of same type under unique name is called:
(a) structure
(b) array
(c) union
(d) function
Q6. ……………. is the organization of data in a file or computer’s memory
(a) array structure
(b) structure
(c) data structure
(d) all the above
Q7. Boolean is a …………data type.
(a) structured
(b) liner
(c) atomic
(d) abstract
Q8. Array is which type of data structure
(a) heterogeneous
(b) infinite
(c) unorder
(d) fixed-length
Q9. Stack is called
(a) FIFO
(b) LIFO
(c) BIFO
(d) TIFO
Q10. Queue is called
(a) FIFO
(b) LIFO
(c) BIFO
(d) TIFO
Q11. Generally In linked list each node contains
(a) 1 member
(b) 2 member
(c) 3 member
(d) 4 member
Q12. Degree of a node is calculated by
(a) subtraction of out-degree and in-degree
(b) sum of out-degree and in-degree
(c) multiplication of out-degree and in-degree
(d) None the above
Q13. A sorting is applied where the entire collection of data to be sorted is small
(a) Merge sorting
(b) Internal sorting
(c) External sorting
(d) Quick sorting
Q14. A binary search method needs no more than………… comparisons.
(a) [Log2N]+1
(b) [Log2N]-1
(c) [Log2N]
(d) [Log N]+1
Q15. What is transversal in the binary tree is
(a) to delete a node from the tree
(b) search for the specified item
(c) visiting the node of the tree one by one
(d) to obtain the exact copy of the given tree
Q16. An Empty tree is
(a) A unary tree
(b) A binary tree
(c) A tree
(d) None the above
Q17. The function is used to obtain the current position of the file pointer
(a) fseek()
(b) ftell()
(c) rewind()
(d) feof()
Q18.Which is the unformatted character I/O function?
(a) getw
(b) putw
(c) getchar
(d) getc
Q19. Structure is a collection of
(a) same data types
(b) different data types
(c) both a and b
(d) none the above
Q20. Which type of variables is initialized automatically?
(a) Automatic
(b) External
(c) Static
(d) Register
Q21. A loop that executes the statements at least once, even if the condition is fails for the first time.
(a) For
(b) While
(c) Do-while
(d) None the above
Q22. When the function call by itself is called
(a) Loop
(b) Recursion
(c) Structure
(d) Union
Q23.How many storage classes are found in C language
(a) 1
(b) 2
(c) 3
(d) 4
Q24. Members of a structure are accessed with ………. Operators
(a) .(dot)
(b) ->
(c) both a and b
(d) none
Q25. sizeof() operator returns the size of data type in
(a) bits
(b) bytes
(c) kilobytes
(d) all the above
Q26. C program should be start as …………
(a) array
(b) function
(c) structure
(d) none the above
Q27. Preprocessor directives are used in C program
(a) including files
(b) conditional compilation
(c) substitution of values
(d) all the above
Q28. Statements which are executed before the program complied is called
(a) comments
(b) preprocessor directives
(c) conditional statements
(d) none the above
Q29. The function which returns the keying in characters in the screen is
(a) getch()
(b) getche()
(c) getchar()
(d) clrscr()
Q30. A directed tee is
(a) Bi-cyclic
(b) acyclic
(c) cyclic
(d) All the above
Part-B
2 Mark Question
Q31. Which is not the advantage of Pointers?
(a) pointers are pointing to different data types and structures
(b) to return single value via function
(c) to achieve a clarity and simplicity
(d) to return multiple value via function
Q32. Which is not the characteristic of abstract data type?
(a) it is export type
(b) it is import type
(c) axioms and preconditions define the application domain of the type
(d) it import a set of operations
Q33. A good hash function:
(a) It is cheap to evaluate
(b) Tends to use all position from O..M with uniform frequency
(c) Tends to put similar keys in different parts of the tables
(d) All the above
Q34. Application of stack is
(a) Recursion
(b) Evaluation of expression
(c) Conversions of expressions
(d) All the above
Q35. Which is the post-order transversal of a binary tree is
(a) L->R->N
(b) R->L->N
(c) L->R->N
(d) N->L>R
Q36. Pointers are used with
(a) function name
(b) array subscript variable
(c) basic data type variable
(d) all the above
Q37. What is the output of following program?
main()
{
int *x,y;
y=12;
x=&y;
printf(“Value of x=%d”,x);
printf(“Value of y=%d”,y);
}
(a) 12,12
(b) 12,0
(c) 0,12
(d) 0,0
Q38. Which statement is true about the variable?
(a) Automatic, External and Static variable, With the same name local variables given high precedence
(b) Automatic, Local and Static variable, With the same name external variables given high precedence
(c) Automatic ,External and Local variable ,With the same name static variables given high precedence
(d) Local ,External and Static variable ,With the same name automatic variables given high precedence
Q39. Which statement is a conditional multiple branching statement.
(a) Break
(b) Continue
(c) Switch
(d) goto
Q40. Which statements are true?
1. The array range starts from zero up to specified final value
2. Subscript range must be –ve integer constant
1. Both are true
2. 1 is true
3. 2 is true
4. Both are false
Q41. Which is not a liner data structure?
(a) array
(b) tree
(c) linked list
(d) queue
Q42. Which is not an internal sort?
(a) insertion sort
(b) quick sort
(c) heap sort
(d) merge sort
Q43. Which statements are true?
1. C is a structured programming language
2. C supports poor set of data types
3. C is unstructured programming language
4. C supports rich set of data types
Answer:
(a) 1,2
(b) 1,3,4
(c) 1,4
(d) 1,2,3
Q44. What is the result of the following program?
int a=10;
x=++a + a++;
(a) 21
(b) 22
(c) 20
(d) error
Q45. Q75. What is the result of the following program?
main()
{
int a;
a=0;
while(a<10);
{
printf(“\nValue is %d”,a);
a++;
}
getch();
}
(a) It will print 0-10 values
(b) It will print 0-9 values
(c) Give error
(d) No result
Part-C
4 Mark Question
Q46. Match the following
Match-1
(a) Ordinary queue
(b) Double ended queue
(c) Circular queue
Match-2
1. item inserted from one end and deleted from another end
2. insertion and deletion will be done either at front end or rear end
3. item inserted from the rear end
Answer:
(a) 1-a,2-b,3-c
(b) 1-b,2-a,3-c
(c) 1-a,2-c,3-b
(d) 1-b,2-c,3-b
Q47. Match the following
Match-1
(a) Merge sort
(b) Heap sort
(c) Insertion sort
Match-2
1. Priority method
2. Divided-and-conquer method
3. Insertion method
(a) 1-a,2-b,3-c
(b) 1-a,2-c, 3-b
(c) 1-b,2-a,3-c
(d) 1-c,2-b,3-a
Q48. Match the following
Match-1
(a) Distribution
(b) Insertion
(c) Selection
(d) Exchange
(e) Merging
Match-2
1. putting an element in the appropriate place in a sorted list
2. rearrange pairs of elements which are out of order
3. extract the largest element form the list, remove it and repeat
4. separate into piles based on the first letter, then sort each pile
5. two sorted lists can be easily combined to form a sorted list
(a) 1-a,2-b,3-c,4-d,5-e
(b) 1-a,2-d,3-e,4-b,5-c
(c) 1-b,2-d,3-c,4-a,5-e
(d) 1-d,2-b,3-a,4-e,5-c
Q49.
Depth of the above tree is
(a) 1
(b) 2
(c) 3
(d) 4
Q50. Level of the node 80 is in the above tree is
(a) 1
(b) 2
(c) 3
(d) 4
Q51. Match the following
Match-1
(a) linked list
(b) circular list
(c) doubly linked list
Match-2
1) A linked list in which the last node points to the first node
2) A list implemented by a set of nodes, each of which points to the next.
3) A list in which each node points to the next node and previous node
Answer:
(a) 1-a,2-b,3-c
(b) 1-b,2-c,3-a
(c) 1-b,2-a,3-c
(d) 1-c,2-a,3-b
Q52.
The preorder transversal of the above binary tree is
(a) 50,20,90,80,30,40,75
(b) 80,20,40,30,75,50,90
(c) 80,40,75,30,20,90,50
(d) 50,20,80,30,40.75,90
Q53. Which statements are true about the W+ mode in the file handling?
1. opened for read and write, and the file contents are lost if file exists
2. opened for read , and the file contents are lost if file exists
3. if the file doesn’t exist, the file is read write and file pointer points to beginning of file
4. if the file doesn’t exist, the file is read write and file pointer points to end of file
Answers:-
(a) 1,3
(b) 1,2,3,4
(c) 1,4
(d) 1,2,3
Q54. Match the following
Match-1
(a) &
(b) *
(c) ->
(d) ::
Match-2
1. Scope resolution operator
2. Address of operator
3. Indirection operator
4. Membership operator
(a) 1-a,2-b,3-c,4-d
(b) 1-b,2-a,3-d,4-c
(c) 1-d,2-a,3-b,4-c
(d) 1-d,2-a,3-c,4-b
Q55. Arrange the following operators in their respective precedence
1. ()
2. %
3. <=
4. &
Answer:
(a) 1,2,3,4
(b) 1,3,2,4
(c) 1,4,3,2
(d) 1,4,2,3
Comments
Post a Comment