[go: up one dir, main page]

0% found this document useful (0 votes)
26 views6 pages

CST 3RD Sem 2ND Internal Model

Uploaded by

payelgiri18
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
26 views6 pages

CST 3RD Sem 2ND Internal Model

Uploaded by

payelgiri18
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 6

ALGORITHMS

1. JA vertex with degree 1 is called as - a) isolated vertex, b) pendant vertex, c) singular vertex, d) zero vertex
1
2. Merge sort is a a) divide and conquer approach, b) greedy approach, c) branch and bound algorithm, d) string algorithm
1
3. The best case time complexity of quick sort is - a) O(nlogn), b) O(n), c) O(n^2), d)O(logn)
4. Which ofthe following is not a sorting technique? - a) heap sort, b) tree sort, c) merge sort, d) isolated sort
5. Which of the following method is used for sorting in merge sort?-a) merging, b) partitioning, c) selection, d) exchanging
6. Which of thefollowing time complexity gives maximum growth rate? -a) O(3^n), b) O(2^n), c) O(n), d) O(nlogn) 1

7. Which of the following is a kind of binary tree? - a) tree, b) branch, c) root, d) BST
8. Which of the following sorting uses concept of complete binary tree? - a) shell sort, b) radix sort, c) heap sort, d) quick sort

9. Which of the following searching is used when array is sorted? - a) binary search, b) linear search, c) exhaustive search, d) 1
|sequentialsearch
10. Which of the following terms is not related to Graph? - a) walk, b) path, c) degree, d) NP hard 1
11. Write down the algorithm for binary search technique. 5
12. Explain walk, trail and path with help of diagrams.
13. Show the steps of bubble sort for the input array {12,32,11,21,3 }.
14. Showthe steps of shellsort for the input array {12,32,11,21,3,7,67,56}. 5
15. a) Compare between linear search and binary search. 2
b) Compare between bubble sort and selection sort. 2
c) What is binary search tree?
COMPUTER SYSTEM ORGANIZATION
1
1. Which directive specifies the end of execution of aprogram. - a) End, b) Return , c) Stop, d) Terminate.
c) Computer 1
2. The CISCstands for - a) Computer Instruction Set Compliment , b)Complete Instruction Set Compliment ,
Indexed Set Components , d) Complex Instruction set computer Deadlock , d) Structural 1
3. The situation wherein the data of operands are not available is called - a) Data hazard, b) Stock, c)
|hazard.
c)Memory Address d)Arithmetic| 1
4. The address in the main memory is known as - a)Logical Address b)Physical Address
Address 1
ERROR.
5. Whenever the data is found in the cache memory it is called as - a) HIT, b) MISS , c) FOUND, d)
c) Set Associative , d)) 1
6. In which mapping, the data can be mapped anywhere in the Cache Memory.- a) Associative , b) Direct,
Indirect
these
7. |An example of direct addressing mode is a) MØV C, B,b) LDA 2021H, c) both a&b,d) none of
access , d) none of these
8. DMA stands for - a) Direct memory adder, b) Direct memory address , c) Direct memory 1
9. The small extremely fast, RAMs are called as - a) heaps, b) accumulators ,c) stacks, d) cache. 1
none of these
10. An example of direct addressing mode is - a) MOV C, B ,b) LDA 2021H,c) both a & b,d) 3
11. l(a) Write down the differences between Procedure and macro.
2
b) what is assembler directives? 5
12. (a) Write short note on i) TLB, ii) Cache memory 3
13. (a) Write the differences between RISC and CISC architecture.
2
b) Define pipeline.
14. (a) Discuss different types of addressing modes with example. 3
15. |(a) Distinguish between near call and far call. 2
(b) Explain virtual memory.
DATA STRUCTURE

1. Which of the following is NOT a type oftreetraversal?- a) Pre-order, b) In-order, c) Post-order, d) Side-order.
2. Which of the following is a property of a binary search tree (BST)?- a) Allnodes have at most one child. b) The left subtree of
a node contains only nodes with values greater than the node. c) The right subtree of a node contains only nodes with values
|less than the node.d) The depth of the left and right subtrees differs by at most one level.
3. What is the purpose of a breadth-first search (BFS) algorithm?- a) Searching in a sorted array, b) Finding the shortest path in a 1
graph, c) Traversinga binary tree, d) Sorting elements in an array
4. What is the main advantage of using a linked list over an array?- a) Constant time access to elements, b) Efficient memory| 1
usage, c) Easy implementation of dynamic resizing, d) Supports random access
5. In the context of trees, what is a leaf node?- a) A node with no children, b) The root node, c) A node with two children, d) A| 1
|node with one child.
6. Which of the following is a non-linear data structure?- a) Stack, b) Queue, c) Linked List, d) Tree. 1

7. Which of the following is an advantage of using a circular linked list?- a. Easier insertion and deletion operations, b)Supports 1
|bidirectionaltraversal, c) Efficient use of memory, d)Simplifies searching for specific elements
8. In the context of trees, what is a parent node?- a) A node with n0 children, b) The root node, c) A node with at least twol 1
children., d) Anode with at least one child.
9. What is the purpose of the "NULL"pointer in linked lists?- a) It points to the first node, b) It indicates the end of the list, c) It 1
points to the previous node, d) It is not used in linked lists.
10. What is the primary goal of tree traversal algorithms?- a) Sorting the tree elements, b) Searching for a specific node, c) 1
Visiting every node in a specific order, d) Balancing the tree.
11. \(a) Write down the pseudo codeto insert an element at a given position of a doubly linked list 3
(b) Write down the pseudo code to delete an element from the front of asingly linked list 2

12. (a) Create a binary tree from given inorder and preorder traversal. Inorder:H,D,B,I,E,A,F,J,C,K,G 4
Preorder:A,B,D,H,E,I,C,F,J, G,K
(b) Define depth and hight ofa tree.
13.(a) construct an AVL tree for the following data: 21,25,29,8,5,15,35,18,16.10,2,3,7,45,31 5
14. (a) Write down the pseudo code for inorder, preorder and postorder traversal. 5
15.(a) Define Binary Search tree.
(6)Write down the difference between DFS and BFS. 2
(c) Construct a B-tree of order 4for the following data: 45,60,30,15,18,40,45,55,20,10,8,7,68,78,90 2
COMPUTER PROGRAMMING IN C
1
characters of string ch to string s?
1. Which among the given options compares atmost n
ch, n), d) int stremp(s, ch)
a) int strncmp(ch, s, n), b) int strcmp(ch, s), c) int strncmp(s, c) strncon), d) memcon()
1
Which function willyou choose to join two words? - a) strcpy(), b) strcat(),
2
terminating null character. - a) strlength(), b)) 1
3. The function returns the number of characters that are present before the
strlen(),c) strlent), d) strchr()
elements as zero? -
4. What are the different ways to initialize an array with all
c=0; int array[5] = fa, b, c}: d) All of the mentioned
a) int array[5] = {}, b) int array[5] = {0};, c) int a =0, b=0,function? - 1
declaration of
5. Which of the following is a correct format for return-type (argument|
|a) return-type function-name(argument type);, b) return-type function-name(argument type){}, c)
type)function-names, d) all of the mentioned
which keyword? -
6. The value obtained in the function is given back to main by using
a) return, b) static, c) new, d) volatile
7. What willbe the output of the following C code?
#include <stdio.h>
void main)

m);
m);

void m)

static int x = 5;
X++;
printf("%d", x);
a) 6 7, b) 6 6, c) 5 5, d) 5 6
1
Which is an indirection operator among the following? - a) &, b) *, c) ->, d). 1
9 What will be the output of the following C code?
#include <stdio.h>
void main)

int x = 0:
int *ptr = &x;
printf("%dn", *ptr);

a) Address of x, b) Junk value, c) 0, d) Run time error


1
10. What willbe the output of the following C code?
#include <stdio.h>
void main()

int a[2][3]={1,2, 3, 4, 5};


int i=0,j=0;
for (i =0; i<2; i++)
for (j = 0; j<3; j++)
printf("%d", a[i][j);

a) 123 450, b) 12345junk, c) 123455, d) Run time error


1
11. (a) Howto declare and initialíze 2D array in C?
(6) Write a C program tofind the transpose ofa Matrix, 2
(c) Write a Cprogram to find the multiplication of two matrix. 3
function in C?
12. l(a) What are the purpose of calloc),malloc)and realloc()
(b) What is the Difference between static memory allocation and dynamic memory allocation?
(c) Difference between Array and Pointer in C.
13. (a) What is the difference between Actual parameter and Formal Parameter in Function.
(b) Write down two C Program that demonstrate the concept of call by value and call by reference. 3

(c) What are adyantages of using Function in C?


14. (a) Explain the storage class in Cusing suitable examples. 1
(b) Define Recursion with advantages & disadvantages?
2
(c) Write a Cprogram to find the factorial of a number using recursion.
15. J(a) What are the advantages of Array in C? 2
(b)Write aC program to find the reverse of aString. 2
(c) Write down the function of i) strlen(), i) strrev),iil) strcmp0,iv) strcat().
SCRIPTING LANGUAGE
1. How do youget the current position within the file?- a) fp.seek(), b) fp.tell(), c) fp.loc, d) fp.pos
2 Which of the following is not a valid mode to open a file?- a) ab, b) rw, c) r+, d) w+ 1
3. square = lambda x: x ** 2 1
a= )
|for iin range(5):
a.append(square(i))
print(a)
What will be the output oftheabove code?- a)[0,1,4,9, 16], b) [1,4,9,16,25], c)[0,1,2,3,4], d)[1,2,3,4,5]
4. dictl= {first': sunday', 'second': 'monday'}
dict2 = (1: 3, 2: 4}
dictl.update(dict2)
print(dictl)
What willbe the output of the above code snippet?- a){'first':Sunday,'second':Monday, 1:3,2:4}, b){'first': 'sunday, 'second'
'monday'}, c){1:3,2:4}, d)None of this
def check(a): 1
print("Even" if a%2 ==0 else "Odd")
check(12)
What will be the output of the above code snippet?- a)Even, b)Odd, c)Error, d)None
6. def thrive(n):
ifn %15 =0:
print("thrive", end =«")
elifn %3!=0 andn %5!= 0:
print("neither", end= «")
elifn %3 ==0:
print("three", end =*")
elifn % 5 =0:
print("five", end =«)
thrive(35)
thrive(56)
thrive(15)
thrive(39)
What will be the output of the above code snippet?- a)Five neither thrive three, b)Five neither three thrive, c)Three three three
, d)Five neither five neither
7. la =[1, 2, 3, 4, 5]
sum = 0
lfor ele in a:
Sum + ele
print(sum)
What willbe the output of the above code snippet?- a)15, b)20, c)10, d)0
8. print(2**3 + (5 + 6)**(1 + 1) ---
What will be the output of the above code snippet?- a)129, b) 121, c)8,d)None
9. How iscode block indicated in python?- a)Brackets, b)Indentation, c)Key, d)None
10. a= [1, 2, 3]
a= tuple(a)
a[0] =2
print(a)
What willbe the output of the abovecode snippet?- a)[2,2,31, b)[1,2,3],c)1,2,3,d) Error 2
recursion.
|11. J(a)Write Python program to find the GCD of two positive numbers using
(b)write down a python program to find factorial for a given number which is taken from the user using function. 3
5
example.
12. (a)Explain different types of argument in python with proper 5
13.(a)Explain different types mode for opening file in python programming 2
function'
14. (a)write down the sort note on 'lambda 3
(b) explain seek) and tell() with proper exampe
15.(a) Write python program nearly equal to test whether two strings are nearly equal. Two
|strings a and b are nearly equal when a can be generated by a single mutation on b.

You might also like