- The recurrence relation that arises in relation with the complexity of binary search is
- T(n)=T(n/2)+k, where k is constant
- T(n)=2T(n/2)+k, where k is constant
- T(n)=T(n/2)+log(n)
- T(n)=T(n/2)+n
- The running time T(n), where `n’ is the input size of a recursive algorithm is given as followsT(n)=c+T(n-1),if n>1
d, if n≤ 1
The order of this algorithm is- n2
- n
- n3
- nn
- The concept of order(Big O) is important because
- it can be used to decide the best algorithm that solves a given problem
- It determines the minimum size of a problem that can be solved in a given system, in a given amount of time
- It is the lower bound of the growth rate of the algorithm
- It is the average bound of the growth rate of the algorithm
- The concept of order(Big O) is important because
- it can not be used to decide the best algorithm that solves a given problem
- It determines the maximum size of a problem that can be solved in a given system, in a given amount of time
- It is the lower bound of the growth rate of the algorithm
- It is the average bound of the growth rate of the algorithm
- The time complexity of an algorithm T(n), where n is the input size is given byT(n)=T(n-1)+/n, if n>1
=1 otherwise
The order of the algorithm is- log n
- n
- n2
- nn
- The running time of an algorithm is given byT(n)=T(n-1)+T(n-2)-T(n-3), if n>3
= n otherwise
The order of this algorithm is- n
- log n
- nn
- n2
- If n=4,then the value of O(log n) is
- 1
- 2
- 4
- 8
- If n=4,then the value of O( n2) is
- 4 Rohith
- 16
- 64
- 512
- The average time complexity of insertion sort is
- O(n2)
- O(n)
- O(1)
- O(log n)
- The running time of an algorithm is given byT(n)=T(n-1)+T(n-2)-T(n-3), if n>3
= n otherwise
What should be the relation between T(1),T(2) and T(3) so that its order is constant.- T(1)=T(2)=T(3)
- T(1)+T(3)=2T(2)
- T(1)-T(3)=T(2)
- T(1)+T(2)=T(3)
- The order of the algorithm that finds a given Boolean function of `n’ variables , produces a is
- constant
- linear
- non-linear
- exponential
- If n=16, then the value of O(n log n) is
- 16
- 32
- 64
- 128
- How many memory management functions are there in C
- 4
- 3
- 2
- 1
- Which of the following is not a C memory allocation function
- alloc( )
- calloc( )
- free
- malloc()
- If n= 8, then the value of O(1) is
- 1
- 2
- 4
- 8
- If n=4, then the value of O(n3) is
- 4
- 16
- 64
- 512
- If n=2, then the value of O(n) is
- 2
- 3
- 4
- 5
- All memory management functions are found in
- stdlib.c
- conio.h
- iostream.h
- math.h
- The function that returns memory to the heap is
- alloc( )
- free( )
- malloc( )
- realloc( )
- Which of the following statement about the releasing memory allocation is false?
- It is an error to dereference a pointer to allocated memory after the memory has been released
- It is an error to free memory with a pointer to other than the first element of an allocated array
- Memory should be freed as soon as it is no longer needed
- To ensure that it is released , allocated memory should be freed before the program
- The syntax of free() function
- void free(void* free)
- int free(void* ptr)
- float free(void* ptr)
- void free(ptr)
- Which of the memory function allocates a block of memory
- malloc ( )
- calloc( )
- release( )
- free( )
- Return type of a calloc( ) function is
- int
- float
- char
- void
- Return type of a realloc( ) function is
- int
- float
- char
- void
- Which of the following memory management function used to release memory
- malloc( )
- calloc( )
- release( )
- free( )
- Which of the following is considered auxiliary storage?
- disk
- random access memeory(RAM)
- read only memory(ROM)
- EEPROM
- Which of the following is not a standard file stream?
- stdin
- stderr
- stdfile
- stdout
- In C, local variable are stored in
- stack
- heap
- permanent storage
- hard disk
- The linked list field(s) are
- data
- pointer
- pointer to next node
- data and pointer to next node
- The linked list structure is defined as Rohith
- struct node
{
int item;
struct node *next;
}; - node
{
int item;
struct node *next;
}; - struct node
{
int item;
node *node;
}; - node
{
Int item;
node next;
};
- struct node
- Dynamic memory area is
- heap
- stack
- permanent storage
- Hard disk
- The contents of the storage space allocated dynamically, can be accessed through _ _ _ _ _ _ _
- structure variables
- pointers
- unions
- arrays
- Each item in the list contains a �link� to structure containing the _ _ _ _ _ _ _ item
- previous
- next
- present
- last
- In C, program instructions are stored in
- stack
- heap
- permanent storage
- Hard disk
- In C, Global variables are stored in
- permanent storage
- stack
- heap
- Hard disk
- In C, static variables are stored in
- heap
- permanent storage
- Hard disk
- Stack
- A list refers to a set of items organized _ _ _ _ _
- sequentially
- exponentially
- non-sequentially
- factorially
- Each structure of a linked list consists _ _ _ _ _ _ _ no. of fields
- 2
- 3
- 4
- 1
- Linked lists are not suitable for data structures of which one of the following problem?
- insertion sort
- Binary search
- radix sort
- polynomial manipulation problem
- An item that is read as input can be either pushed to a stack and latter popped and printed, or printed directly. Which of the following will be the output if the input is the sequence of items-1,2,3,4,5?
- 3,4,5,1,2
- 3,4,5,2,1
- 1,5,2,3,4
- 5,4,3,1,2
- of pointers to be manipulated in a linked list to delete an item in the middle _ _ _ _ _ _ _
- Zero
- One
- Two
- Three
- of pointers to be manipulated in a linked list to delete first item
- Zero
- One
- Two
- Three
- Stack is useful for _ _ _ _ _ _ _
- radix sort
- breadth first search
- recursion
- quick sort
- The end of the list is marked as
- next=0
- (node.last = 0)
- next= &node;
- previous=0;
- of pointers to be manipulated in a linked list to insert an item in the middle _ _ _ _ _ _ _ _
- Two
- Three
- One
- Zero
- of pointers to be manipulated in a linked list to delete last item
- Zero
- One
- Two
- Three
- Single linked list uses _ _ _ _ _ _ no. of pointers
- Zero
- one
- Two
- Three
- LIFO is
- stack
- queue
- linked list
- tree
- A stack is has the entries a,b,c,(with a on top). Stack B is empty. An entry popped out of stack A can be printed immediately or pushed to stack B.An entry popped out of stack B can only be printed. In this arrangement, which of the following permutations a,b,c is not possible?
- b a c
- b c a
- c a b
- a b c