1.Consider the following definition in C programming languagestruct node { int data; struct node * next;}typedef struct node NODE;NODE *ptr;Which of the following c code is used to create new node?( )
A:ptr=(NODE*)malloc(sizeof(NODE)); B:malloc(sizeof(NODE)); C:ptr=(NOD D:ptr=(NODE*)malloc(NODE); E:ptr=(NODE*)malloc(sizeof(NODE*));
答案:ptr=(NODE*)malloc(sizeof(NODE));
2.26. Identify the recursive expression to obtain the nth Fibonacci number using recursion. ( )
A:fib(n)=fib(n+1)+fib(n+2) B:fib(n-1)=fib(n)+fib(n+1) C:fib(n+1)=fib(n)+fib(n-1) D:fib(n)=fib(n-1)+fib(n-2)
答案:b
3.Consider the following C code, where stack is implemented using the array.#define MAX 10struct STACK {    int arr[MAX]    int top = -1;}In this implementation of stack, maximum value of top which cannot cause overflow will( )
A:-1 B:9 C:1 D:10
答案:9
4.45. If there are n non-zero terms in a polynomial, the size of the array required would be________.( )
A:2n-1 B:2n+1 C:n D:2n
答案:n
5.39. In the polynomial, A(x)= x4+10x3+3x2+1, what is (coefficient, exponent) pair of last term? ( )
A:(0,1) B:(1,4) C:(4,1) D:(1,0)
答案:(1,0)
6.Deletion of an element from the array reduces the size of array by ( )
A:one B:three C:zero D:two
答案:one
7.A normal queue, if implemented using an array of size MAX_SIZE in C, gets full when( )
A:front=rear+1 B:rear=MAX_SIZE-1 C:rear=front D:front=(rear+1)mod MAX_SIZE
答案:rear=MAX_SIZE-1
8.Nodes that have degree zero are called ________nodes.( )
A:child B:non-terminal C:root D:leaf
答案:leaf
9.If the elements “A”, “B”, “C” and “D” are placed in a queue and are deleted one at a time, in what order will they be removed( )
A:ABDC B:DCBA C:DCAB D:ABCD
答案:ABCD
10.Array which is having ____________ dimensions is called as 2-D array.( )
A:4 B:3 C:1 D:2
答案:2
11.If we have declared an array as int arr[6]; then which of the following array element is considered as last array element in C?( )
A:arr[0] B:arr[5] C:arr[6] D:arr[4]

12.If the elements “A”, “B”, “C” and “D” are placed in a stack and are deleted one at a time, in what order will they be removed?( )
A:DCAB B:ABCD C:ABDC D:DCBA 13.What data structure would you mostly likely see in implementation of a recursive algorithm?( )
A:Queue B:Tree C:Array D:Stack 14.Children of the same parent said to be______nodes.( )
A:root B:child C:sibling D:leaf 15.If we store the nodes of a binary tree in an array with index starting from zero, if the leftchild is at index n, its right brother at( )
A:2n+2 B:(n-1)/2 C:2n+1 D:n+1  16.User perform following operations on stack of size five : push(1);pop();push(2);push(3);pop();push(4);pop();pop();push(5); at the end of last operation, total number of elements present in the stack are( )
A:D.1 B:A.3 C:C.2 D:B.4 17.What would be the asymptotic time complexity to find an element in the linked list?
A:None B:O(n) C:O(n²) D:O(1) 18.A variant of linked list in which last node of the list points to the first node of the list is?( )
A:Multiply linked list B:Singly linked list C:Circular linked list D:Doubly linked list 19.26. Identify the recursive expression to obtain the nth Fibonacci number using recursion. ( )
A:fib(n)=fib(n+1)+fib(n+2) B:fib(n-1)=fib(n)+fib(n+1) C:fib(n+1)=fib(n)+fib(n-1) D:fib(n)=fib(n-1)+fib(n-2) 20.In algorithm which converts infix expression to postfix expression. the ICP stands for( )
A:In-Coming Priority B:Inside-Count Priority C:In-Count Primary  D:None of the above 21.45. If there are n non-zero terms in a polynomial, the size of the array required would be________.( )
A:2n-1 B:2n+1 C:n D:2n 22.24. A function which calls itself is called as ______function.( )
A:recursive B:iterative C:static D:dynamic 23.In the stack, if user try to remove element from the empty stack then it called as ( )
A:garbage B:underflow C:empty D:overflow 24.66. If an algorithm include two for (or while) loops, the time complexity of algorithm may become________.( )
A:constant B:linear. C:logarithmic. D:quadratic 25.The preorder traversal sequence of a binary search tree is 30, 20, 10, 15, 25, 23, 39, 35, 42.
Which one of the following is the postorder traversal sequence of the same tree?( )
A:15, 10, 25, 23, 20, 42, 35, 39, 30 B:15, 20, 10, 23, 25, 42, 35, 39, 30 C:15, 10, 23, 25, 20, 35, 42, 39, 30 D:10, 20, 15, 23, 25, 35, 42, 39, 30 26.The ______implementation uses arrays to create stack.( )
A:linked B:static  C:dynamic D:linear 27.68. What is the not the property of linked list? ( )
A:The space required is proportional to its length B:Random access of any node is easy C:There is no need to estimate the storage space  D:Insertion and deletion do not require the element to be moved 28.48. What is the maximum number of nodes with degree zero in a binary tree at level 3? ( )
A:3 B:5 C:9 D:4 29.Identify the infix expression.( )
A:None of the above B:+A B C:AB+  D:A+B 30.In order to keep track of current topmost element of the stack we need to maintain one variable called( )
A:false B:bottom C:top D:true 31.When user switch from one function to other then the details of previous function are stored into the stack.( )
A:True B:False 32.Array which is having ____________ dimensions is called as 2-D array.( )
A:4 B:3 C:1 D:2 33.The ________notation is used in Computer Science to describe the performance or complexity of an algorithm.( )
A:Big P B:Small Oh C:Big D:Big Oh 34.4. Within a computer, all information is accessed, processed and transmitted in the form of:( )  
A:Hexadecimal B:BCD  C:ACSII D:Binary  35.Which of the following data structures is a nonlinear structure? ( )
A:Binary tree B:Stack  C:Queue  D:Linked list  36.64. What of the following statements is incorrect regarding linked lists? ( )
A:Linked lists are example for dynamic data structure B:Linked lists example for linear data structure C:Linked lists can be circular D:Linked lists is an example of nonlinear data structure 37.Which of the following case does not exist in complexity theory ( )
A:Worst case B:Average case C:Best case D:Null case 38.14. The following is not the basic operation of the queue? ( )
A:Remove the ith element from the queue B:Insert a new element at the end of queue C:Reads the value of queue header  D:Determines if the queue is empty 39.A queue is a __________data structure.( )
A:Ordered array B:LIFO (Last In First Out) list. C:FIFO (First In First Out) list D:Linear tree

温馨提示支付 ¥3.00 元后可查看付费内容,请先翻页预览!
点赞(8) dxwkbang
返回
顶部