sdp4

Descripción

SDP4 Test sobre sdp4, creado por Csse 1502 el 21/05/2017.
Csse 1502
Test por Csse 1502, actualizado hace más de 1 año
Csse 1502
Creado por Csse 1502 hace casi 7 años
978
1

Resumen del Recurso

Pregunta 1

Pregunta
Re-balancing of AVL tree costs
Respuesta
  • O(logn)
  • O(nlogn)
  • O(1)
  • O(n)

Pregunta 2

Pregunta
In what tree, for every node the height of its left subtree and right subtree differs at least by one
Respuesta
  • Threaded binary tree
  • BST
  • AVL tree
  • Complete tree

Pregunta 3

Pregunta
Which of the following is true about the total number of nodes in a binary tree with depth two?
Respuesta
  • It is at most four
  • It is at most seven
  • There is no bound on the number of nodes
  • It is at most two

Pregunta 4

Pregunta
Which of the following is not a valid binary search tree?

Pregunta 5

Pregunta
The result of postfix expression: 4 2 + 3 5 1 - * +
Respuesta
  • 18
  • 10
  • 15
  • 8

Pregunta 6

Pregunta
The infix expression A+((B-C)*D) is correctly represented in prefix notation as
Respuesta
  • A+BC-D*
  • ABC-D*+
  • +A*-BCD
  • A+B-C*D

Pregunta 7

Pregunta
The result of postfix expression: 5 7 + 6 2 - *
Respuesta
  • 40
  • 38
  • 46
  • 48

Pregunta 8

Pregunta
The prefix expression reverse to postfix: * + A B + C D
Respuesta
  • A B + C D + * *
  • A B + C D + *
  • None of them
  • A B + C D * +

Pregunta 9

Pregunta
What the result of the following expression: 2 3 8 * + 4 48 4 2 + / 6 * + -
Respuesta
  • -26
  • 12
  • -20
  • -10

Pregunta 10

Pregunta
By definition, a(n)______ graph contains edges that can be traversed in either direction.
Respuesta
  • undirected
  • directed
  • disconnected
  • connected

Pregunta 11

Pregunta
What is the weight of a minimum spanning tree of the following graph?
Respuesta
  • 31
  • 35
  • 41
  • 38
  • 29

Pregunta 12

Pregunta
Which of the following algorithms use a dynamic programming approach (not greedy)? Выберите один или несколько ответов:
Respuesta
  • Floyd Algorithm
  • Bellman-Ford Algorithm
  • Dijkstra Algorithm
  • Prim Algorithm

Pregunta 13

Pregunta
The MST of the graph below:
Respuesta
  • 3, 1, 2, 9, 4, 7, 5
  • 3, 1, 2, 9, 10, 7, 5
  • 3, 1, 2, 9, 11, 7, 5
  • 3, 1, 2, 9, 4, 7, 8

Pregunta 14

Pregunta
What is the Run-time of the Dijkstra’s original algorithm? (without min priority queue)
Respuesta
  • O(E+V)
  • O(E+VlogV)
  • O(E^2)
  • O(V^2)

Pregunta 15

Pregunta
Choose the algorithm with not greedy approach ….
Respuesta
  • Prim Algorithm
  • Dijkstra Algorithm
  • Floyd Algorithm
  • Kruskal Algorithm

Pregunta 16

Pregunta
The Floyd-Warshall algorithm for all-pair shortest paths computation is based on:
Respuesta
  • Greedy paradigm
  • Dynamic Programming paradigm
  • None
  • Divide-and-Conquer paradigm

Pregunta 17

Pregunta
The sequence of visited nodes by Dijkstra algorithm:
Respuesta
  • S, B, A, С, t
  • None of them
  • S, A, B, C, t
  • S, B, A, t

Pregunta 18

Pregunta
The following heap : 18 15 9 14 11 2 7 6 12 3, add there 17 and choose right sequence:
Respuesta
  • 18 17 9 14 15 2 7 12 6 3 11
  • 18 15 9 14 11 2 7 6 12 3 17
  • 18 17 9 14 15 2 7 6 11 12 3
  • 18 17 9 14 15 2 7 6 12 3 11

Pregunta 19

Pregunta
In the deletion operation of max heap, the root is replaced by:
Respuesta
  • Last element of the last level
  • Next available value in the right sub-tree
  • Next available value in the left sub-tree
  • Any random value from the heap

Pregunta 20

Pregunta
Delete max element from the heap and choose the answer: 18 17 9 14 15 2 7 6 12 3 11
Respuesta
  • 17 15 9 14 12 11 2 7 6 3
  • 17 15 9 14 11 2 7 6 12 3
  • 17 9 14 15 2 7 6 12 3 11
  • 17 15 14 12 11 9 2 7 6 3

Pregunta 21

Pregunta
In a min heap
Respuesta
  • A minimum values are sorted
  • Parent nodes have less value than child nodes
  • Maximum value is contained by the root node
  • Child nodes have less value than parent nodes

Pregunta 22

Pregunta
The result of this postfix expression: 10 5 + 60 6 / * 8 – is
Respuesta
  • 82
  • 284
  • 273
  • 142

Pregunta 23

Pregunta
Please find the postfix expression from prefix: - * - + a b c / e f - g / h i
Respuesta
  • a b + c - - e f / * g h i / -
  • a b + c - e f / * g h - i / -
  • a b + c - e f / * g h i / -
  • a b + c - e f / * g h i / - -

Pregunta 24

Pregunta
If this tree is used for sorting, then new no 8 should be placed as the
Respuesta
  • right child of the node labelled 5
  • right child of the node labelled 30
  • left child of the node labelled 10
  • left child of the node labelled 30

Pregunta 25

Pregunta
Number of possible binary trees with 3 nodes is (Kahoot 100%)
Respuesta
  • 9
  • 3
  • 14
  • 5

Pregunta 26

Pregunta
The result of this postfix expression: 4 5 7 2 + - *
Respuesta
  • -10
  • -11
  • -16
  • -5

Pregunta 27

Pregunta
Which of the following statements about binary trees is true?
Respuesta
  • A binary tree contains exactly two nodes.
  • Exactly two paths exist between any two nodes in a binary tree.
  • Every node of a binary tree has at most two children.
  • Every node of a binary tree has at most two predecessors.

Pregunta 28

Pregunta
A binary tree T has 20 leaves. The number of nodes in T having two children is
Respuesta
  • Any number between 10 and 20
  • 18
  • 19
  • 17

Pregunta 29

Pregunta
Choose the Bipartite graph from the following graphs...

Pregunta 30

Pregunta
Each of the following indicates a reasonable way to implement graphs except
Respuesta
  • a BST
  • a Boolean matrix
  • an adjacency list
  • an edge list

Pregunta 31

Pregunta
Postfix expression is just a reverse of prefix expression.
Respuesta
  • Верно
  • Неверно

Pregunta 32

Pregunta
Choose the regular expression which -- "Search all string which start with "a"
Respuesta
  • a*
  • a+
  • a$
  • ^a

Pregunta 33

Pregunta
Which of the following algorithms use a greedy approach?
Respuesta
  • Prim, Kruskal, Floyd
  • Prim, Kruskal, Dijkstra
  • Prim, Bellman-Ford, Floyd
  • Prim, Kruskal, Bellman-Ford

Pregunta 34

Pregunta
A max-heap is a heap where the value of each parent is greater than or equal to the values of its children. Which of the following is a max-heap?
Respuesta
  • B
  • C
  • D
  • A

Pregunta 35

Pregunta
Heap with n elements with the smallest element at the root, 7 smallest element can be found
Respuesta
  • O(1)
  • O(n)
  • O(nlogn)
  • O(logn)

Pregunta 36

Pregunta
The elements 32, 15, 20, 30, 12, 25, 16 are inserted one by one in the given order into a Max Heap. The result Max Heap is
Respuesta
  • C
  • B
  • D
  • A

Pregunta 37

Pregunta
Group A Group B a) Dijkstra's single shortest path algo p) Dynamic Programming b) Bellmen Ford's single shortest path algo q) Greedy Algorithm c) Floyd Warshell's all pair shortest path algo. r) Backtracking
Respuesta
  • a-q, b-p, c-p
  • a-p, b-p, c-p
  • a-r, b-q, c-p
  • a-p, b-r, c-q

Pregunta 38

Pregunta
Time complexity of Depth First Traversal of is
Respuesta
  • Θ(|V|*|E|)
  • Θ(|V|)
  • Θ(|V|+|E|)
  • Θ(|E|)

Pregunta 39

Pregunta
The time complexity of heap sort in worst case is
Respuesta
  • O(nlogn)
  • O(n)
  • O(n2)
  • O(logn)

Pregunta 40

Pregunta
Which of the following algorithms has lowest worst case time complexity?
Respuesta
  • Quick sort
  • Selection sort
  • Insertion sort
  • Heap sort

Pregunta 41

Pregunta
BST: 50, 15, 62, 5, 20,58, 91, 3,8 The number of nodes in the left of the root is
Respuesta
  • 4
  • 5
  • 3
  • 7

Pregunta 42

Pregunta
Heap is an example of
Respuesta
  • BST
  • Complete BST
  • Spanning tree
  • General tree

Pregunta 43

Pregunta
What is the run-time complexity of the Floyd-Warshall algorithm? (worst case performance)
Respuesta
  • O(V^2)
  • O(V*E)
  • O(V+E)
  • O(V^3)

Pregunta 44

Pregunta
For all binary search trees, where d represents the depth of a tree and n represents the number of nodes, the worst-case complexity of searching for an element is
Respuesta
  • O(n/d)
  • O(n*d)
  • O(d)
  • O(n)

Pregunta 45

Pregunta
Which of the following statements is true of both depth-first and breadth-first searches?
Respuesta
  • Their implementations each require a stack of nodes.
  • From a given starting node, they will not necessarily explore all other nodes in a graph.
  • Their implementations each require a queue of nodes.
  • They can each be used calculate the shortest path between two nodes in a weighted graph.

Pregunta 46

Pregunta
BST run-time complexity of search function in worst case is
Respuesta
  • O(n)
  • O(logn)
  • O(n^2)
  • O(nlogn)

Pregunta 47

Pregunta
In a binary min heap containing n numbers, the smallest element can be found in time
Respuesta
  • O(1)
  • O(logn)
  • O(n)
  • none of this

Pregunta 48

Pregunta
A full binary tree n leaves contains
Respuesta
  • n nodes,
  • 2n-1 nodes
  • n nodes
  • 2n nodes

Pregunta 49

Pregunta
Which one of the following array represents a binary max-heap?
Respuesta
  • 25,12,16,13,10,8,14,
  • 25,14,12,14,10,8,16
  • 25,14,16,13,10,8,12
  • 25,12,16,13,10,8,14

Pregunta 50

Pregunta
In a binary max heap containing n numbers,the smallest element can be found in time
Respuesta
  • O(n)
  • O(logn)
  • O(1)
  • O(nlogn)

Pregunta 51

Pregunta
The maximum number of nodes on level i of a binary tree is
Respuesta
  • 2i-1
  • i+1
  • 3i-1
  • 2i+2

Pregunta 52

Pregunta
Which algorithms – can find vertices x & y if there are presented a path between them?
Respuesta
  • DFS
  • BFS
  • Both BFS and DFS
  • None of them

Pregunta 53

Pregunta
Choose the trasitive closure for the graph below
Respuesta
  • 1 1 1 1 1 1 1 1 1 1 1 1 0 0 0 1
  • 1 0 1 1 1 1 1 1 1 1 1 1 0 0 0 0
  • 1 1 1 1 1 1 1 1 1 1 0 0 0 0 0 1
  • 1 0 0 1 1 1 1 1 0 1 0 1 0 0 0 1

Pregunta 54

Pregunta
What is the run-time complexity of the Kruskal's algorithm? (average performance)
Respuesta
  • O(ElogV)
  • O(V^3)
  • O(VlogE)
  • O(V^2)

Pregunta 55

Pregunta
Suppose we run Dijkstra’s single source shortest-path algorithm. Find the minimum path from P to U and what sequence of visited points you have?
Respuesta
  • P, S, R, U
  • P, Q, S, U
  • P, Q, R, U
  • P, Q, R, S, U

Pregunta 56

Pregunta
How does the use of parenthesis change the expression tree? Which graph below represents the equation 3+2*4-1

Pregunta 57

Pregunta
What is the result of the program below? #include <stdio.h> int main(){ char *ch; while(x=0; x<=255; x++) printf(“ASCII value of %d character %c\n”,x,x); return 0; }
Respuesta
  • The code prints all ASCII values and its characters
  • Error: x undeclared identifier
  • The code generates an infinite loop
  • Error: while statement missing

Pregunta 58

Pregunta
What is the output of the following program? #include <stdio.h> int main(){ char *nstring=”Hello”; while(*nstring) printf(“%c”, *nstring++); }
Respuesta
  • ello
  • Runtime error
  • Compile error
  • Hello

Pregunta 59

Pregunta
What will be the output of the program? #include <stdio.h> int main(){ int k, num=30; k=(num>5 ? (num <= 10? 100 : 200):500); printf("%d\n", num); return 0; }
Respuesta
  • 30
  • 500
  • 200
  • 100

Pregunta 60

Pregunta
What statement can print \n on the screen? #include <stdio.h> int main(){ printf("\\n"); return 0; }
Respuesta
  • None
  • printf(“n\”);
  • printf(“\\n”);
  • printf(“n”);
  • printf(“\n”);

Pregunta 61

Pregunta
How many times the program will print “Hello”? #include<stdio.h> int main(){ printf("Hello"); main(); return 0; }
Respuesta
  • 0
  • Compilation error
  • Unlimited times
  • Till stack run over

Pregunta 62

Pregunta
What is the built library function to compare two strings?
Respuesta
  • IsEqual();
  • Strcmp();
  • Strcompare();
  • Strstr();

Pregunta 63

Pregunta
According to ANSI specification, how to declare main() function with command-line arguments?
Respuesta
  • int char main(int argc, *argv)
  • None
  • int main(){ int char (*argv argc); }
  • int main(int argc, char *argv[])

Pregunta 64

Pregunta
Queue worst time complexity to delete some value…
Respuesta
  • O(1)
  • O(n^2)
  • O(log n)
  • O(n)

Pregunta 65

Pregunta
The keys 12,18,13,2,3,23,5 and 15 are inserted into an initially empty hash table of length 10 using open addressing with hash function h(k)=k mod 10 and linear probing. What is the resultant hash table?
Respuesta
  • A
  • B
  • D
  • C

Pregunta 66

Pregunta
What is the worst time complexity of the hash table in Big O notation?
Respuesta
  • O(n logn)
  • O(n)
  • O(1)
  • O(log n)

Pregunta 67

Pregunta
Stack works by the principle
Respuesta
  • LILO
  • FIFO
  • LIFO
  • FILO

Pregunta 68

Pregunta
Linked list is generally considered as an example of ____ type of memory allocation.
Respuesta
  • Compile time
  • Static
  • Dynamic
  • Local

Pregunta 69

Pregunta
A hash table of length 10 uses open addressing with hash function h(k)=k mod 10, and linear probing. After inserting 6 values into an empty hash table, the table is as shown below.
Respuesta
  • 42,46,33,23,34,52
  • 46,42,34,52,23,33
  • 34,42,23,52,33,46
  • 46,34,42,23,52,33

Pregunta 70

Pregunta
An algorithm is
Respuesta
  • A loosely written code to make final code
  • A step by step procedure to solve problem
  • All of the above
  • A piece of code to be executed

Pregunta 71

Pregunta
What is the best time complexity of the binary search?
Respuesta
  • O(n)
  • O(1)
  • O(log n)
  • O(n logn)

Pregunta 72

Pregunta
What is the sorting algorithms is presented on the example below?
Respuesta
  • Insertion sort
  • Radix sort
  • Quick sort
  • Bucket sort

Pregunta 73

Pregunta
Which sorting algorithms is most efficient to sort string consisting of ASCII characters?
Respuesta
  • Quick sort
  • None
  • Counting sort
  • Merge sort

Pregunta 74

Pregunta
A pivot element to partition unsorted list is used in
Respuesta
  • Quick sort
  • Insertion sort
  • Merge sort
  • Selection sort

Pregunta 75

Pregunta
What is the gcc?
Respuesta
  • The command to create new file
  • The command to show all errors during compiling
  • The command doesn’t exist
  • The compiler

Pregunta 76

Pregunta
What is rmdir command in Unix OS?
Respuesta
  • This command creates a directory
  • This command copies a file
  • This command removes a file
  • This command removes(deletes) a directory

Pregunta 77

Pregunta
What is touch command in Unix OS?
Respuesta
  • This command builds products based on rules contained in a file
  • This command updates the last modification time of a file or directory
  • These commands allow you to view the contents of a file without editing the file
  • This family of commands allows you to open files for editing

Pregunta 78

Pregunta
“.” In Unix like systems
Respuesta
  • Refers to the containing directory
  • Refers to your home directory
  • Refers to the root directory
  • Refers to the current directory

Pregunta 79

Pregunta
The default executable generation on Unix for a C program is
Respuesta
  • a.exe
  • default.out
  • a.out
  • out.a

Pregunta 80

Pregunta
In the given below statement,what does the “arr” indicate? char *arr[30];
Respuesta
  • arr is a pointer to an array
  • arr is a array of 30 characters
  • arr is a array of function
  • arr is a array of 30 character pointers

Pregunta 81

Pregunta
What function is used to free the allocated memory for the program below? #include <stdio.h> #include<stdlib.h> int main(){ int *k; k=(int*) malloc(10* sizeof(int)); return 0; }
Respuesta
  • clean k;
  • delete k;
  • free(k);
  • memfree(k);

Pregunta 82

Pregunta
Which library functions help users to dynamically allocate memory?
Respuesta
  • malloc(), memalloc()
  • macalloc(), calloc()
  • realloc(), calloc()
  • malloc(), calloc()

Pregunta 83

Pregunta
Which header statement is missing in the given below program to get the desired output? #include <stdio.h> int main(){ double x=1234321; if(isdigit(x)){ printf("%lf",x); return 0; }
Respuesta
  • #include <ctype.h>
  • #include <math.h>
  • #include <string.h>
  • #include <stdlib.h>

Pregunta 84

Pregunta
Accessing top element in stack is constant time operation
Respuesta
  • Верно
  • Неверно

Pregunta 85

Pregunta
Process of Removing element from the stack is called as…(C++)
Respuesta
  • push
  • pop
  • delete
  • clean

Pregunta 86

Pregunta
A linked list in which the last node of Linked list points to the first is called a______
Respuesta
  • doubly LL
  • singly LL
  • hybrid LL
  • circular LL

Pregunta 87

Pregunta
A doubly linked list performs traversal in____
Respuesta
  • none
  • either direction
  • circular direction
  • any direction

Pregunta 88

Pregunta
LL is used to implement the Stack then which of the following node is - Top of the Stack?
Respuesta
  • middle node
  • first node
  • any node
  • last node

Pregunta 89

Pregunta
What is the worst time complexity of the binary search algorithm?
Respuesta
  • O(1)
  • O(logn)
  • none
  • O(n)

Pregunta 90

Pregunta
What is the worst time complexity of the bubble sort?
Respuesta
  • O(n^2)
  • O(n)
  • O(nlogn)
  • O(n^3)

Pregunta 91

Pregunta
Which of the following sorting algorithms has the lowest worst-case complexity?
Respuesta
  • Bubble Sort
  • Selection Sort
  • Quick Sort
  • Merge Sort

Pregunta 92

Pregunta
What is make command in Unix OS?
Respuesta
  • This command builds products based on rules contained in a makefile
  • This command compiles a Java program
  • This command is most commonly used to display the contents of a file on the terminal
  • This is the compiler, which can take many options

Pregunta 93

Pregunta
What is ls command in UNIX OS?
Respuesta
  • This command creates a directory
  • This command renames an entity
  • This command list the contents of a directory
  • This command displays the path of the current directory

Pregunta 94

Pregunta
Unix command mv ___
Respuesta
  • This command renames an entity
  • This command removes(deletes) a directory
  • This command removes a file
  • This command copies a file

Pregunta 95

Pregunta
The keyboard used to transfer control from a function back to the calling function is
Respuesta
  • switch
  • return
  • go back
  • go to

Pregunta 96

Pregunta
What is the result of the program? #include<stdio.h> int main() { int const a = 5; a++; printf("%d", a); }
Respuesta
  • Stack is run over
  • None
  • 5
  • Compilation error

Pregunta 97

Pregunta
What value strcmp() function returns when two strings are the same?
Respuesta
  • true
  • 0
  • -1
  • 1

Pregunta 98

Pregunta
Stack time complexity to insert some value …
Respuesta
  • O(1)
  • O(n)
  • O(logn)
  • O(n/logn)

Pregunta 99

Pregunta
Which if the following is not a type of Linked list?
Respuesta
  • hybrid LL
  • singly LL
  • doubly LL
  • circular LL

Pregunta 100

Pregunta
Queue can be implemented using a list
Respuesta
  • Верно
  • Неверно

Pregunta 101

Pregunta
Which of the following container has search efficiency of O(1) (Best case)
Respuesta
  • Doubly Linked List
  • Hash table
  • Heap
  • Linked List

Pregunta 102

Pregunta
“/” in Unix like systems
Respuesta
  • refers to the current directory
  • refers to the containing directory
  • refers to your home directory
  • refers to the root directory

Pregunta 103

Pregunta
Unix command pwd_____
Respuesta
  • This command removes a file
  • This command creates a directory
  • This command displays manual pages for various commands
  • This command displays the path of the current directory

Pregunta 104

Pregunta
A linked-list is a dynamic structure
Respuesta
  • Верно
  • Неверно

Pregunta 105

Pregunta
What are two operators for ascending members of a structure and when are they used?
Respuesta
  • none
  • and->
  • and this
  • and-->

Pregunta 106

Pregunta
What is the malloc & calloc?
Respuesta
  • allocate the dynamic memory
  • allocate the dynamic memory and save zero there
  • create new variable
  • free dynamic memory

Pregunta 107

Pregunta
A local variable is stored in __
Respuesta
  • heap segment
  • stack segment
  • code segment
  • none

Pregunta 108

Pregunta
Which scanf(statement will you use to scan a float variable (a) and double variable (b)?
Respuesta
  • scanf(“%f%lf”, &a, &b);
  • scanf(“%lf%lf”, &a, &b);
  • scanf(“%f%f”, &a, &b);
  • scanf(“%Lf%Lf”, &a, &b);

Pregunta 109

Pregunta
A single line comment in C language source code can begin with __
Respuesta
  • :
  • /*
  • ;
  • //

Pregunta 110

Pregunta
Only top element can be accessed in stack
Respuesta
  • верно
  • неверно

Pregunta 111

Pregunta
Each Node contain minimum two fields one field called data field to store data. Another field _
Respuesta
  • pointer to Node
  • pointer to character
  • pointer to an integer
  • pointer to class

Pregunta 112

Pregunta
A hash table of length 10 uses quadratic function h(k)=k mod 10. After inserting 6 values into an empty hash table, the table is as shown below. 0 1 2 42 3 23 4 34 5 6 52 7 46 8 9 33 Which one of the following choices given a possible order in which the key values could have been inserted in the table?
Respuesta
  • 46, 42, 34, 52, 23, 33
  • 34, 42, 23, 52, 33, 46
  • 42, 23, 34, 52, 46, 33
  • 46, 34, 42, 23, 52, 33

Pregunta 113

Pregunta
How do you specify double constant 3.14 as a long double?
Respuesta
  • %Lf
  • %ld
  • %f
  • %lf

Pregunta 114

Pregunta
What built in library function to adjust the allocated dynamic memory size
Respuesta
  • calloc
  • malloc
  • recalloc
  • realloc

Pregunta 115

Pregunta
Queue works by the principle
Respuesta
  • Last in First out
  • none
  • First in First out FIFO
  • First in Last out

Pregunta 116

Pregunta
How to convert some data to the lower case in C programming language?
Respuesta
  • toupper(); #include <ctype.h>
  • tolower();, #include <stdlib.h>
  • toupper(); #include <stdlib.h>
  • tolower();, #include <ctype.h>

Pregunta 117

Pregunta
How to create the boolean type in C without usage of #include <stdbool.h>
Respuesta
  • _Bool
  • boolean
  • _Boolean
  • bool

Pregunta 118

Pregunta
“r+” in fopen function tries to open the file for …
Respuesta
  • read & write
  • append new content to the file
  • only reading this file
  • reading and append new content to the file

Pregunta 119

Pregunta
Linked list works by the FIFO method
Respuesta
  • верно
  • неверно

Pregunta 120

Pregunta
What is best time complexity of search operation in the LL?
Respuesta
  • O(logn)
  • none
  • O(1)
  • O(n)

Pregunta 121

Pregunta
What is the general formula for double hashing in the hast table?
Respuesta
  • h( k, i) = ( h1(k) + i * h2(k)) mod m
  • none
  • h(x) = x mod m
  • h (k, i) = ( h’(k) + i^2) mod m

Pregunta 122

Pregunta
What function can be used to free the memory allocated by calloc()?
Respuesta
  • delete();
  • strcat();
  • free();
  • memfree();

Pregunta 123

Pregunta
Identify the incorrect file opening mode from the following
Respuesta
  • r
  • x
  • w
  • a

Pregunta 124

Pregunta
In the stack process of inserting an element in the stack is called as _____
Respuesta
  • push
  • insert
  • pop
  • create

Pregunta 125

Pregunta
What is the output of the following program? #include <stdio.h> int main(){ int a[] = {2,1}; printf("%d", *a); }
Respuesta
  • 2
  • 0
  • 1
  • Compile error

Pregunta 126

Pregunta
The merge sort algorithm is based on:
Respuesta
  • Divide-and-Conquer paradigm
  • Greedy paradigm
  • Dynamic Programming paradigm
  • None of these

Pregunta 127

Pregunta
Recursion uses more memory space than iteration because
Respuesta
  • None of them
  • it uses stack instead of queue & every recursive call has to be stored
  • every recursive call has to be stored
  • it uses stack instead of queue

Pregunta 128

Pregunta
Shell sort uses
Respuesta
  • quick sort
  • insertion sort
  • selection sort
  • merge sort

Pregunta 129

Pregunta
What is the result of the program below? #include <stdio.h> int main(){ int a=9, b=&a, *pointer=b+0; printf("%u", *pointer); }
Respuesta
  • Address of pointer
  • Compile error
  • Segmentation fault
  • 9
  • 0

Pregunta 130

Pregunta
What is the maximum number of nodes that a perfectly balanced tree with a height of 7 can contain?
Respuesta
  • (2**8)-1 = 255 (Maximum) (2**7) = 128 (Minimum)
  • (2**7)-1 = 127 (Maximum) (2**5) = 32 (Minimum)
  • (2**7)-1 = 127 (Maximum) (2**6) = 64 (Minimum)
  • (2**6)-1 = 63 (Maximum) (2**5) = 32 (Minimum)

Pregunta 131

Pregunta
Find the MST from the graph below:
Respuesta
  • (FB), (HC), (BC), (IH), (AB), (EC), (ED), (EG)
  • (FB), (HC), (BC), (IH), (AB), (EA), (ED), (EG)
  • (FB), (HC), (BC), (IH), (AB), (EA), (ED), (HE)
  • (FB), (HC), (BC), (IH), (AB), (EC), (FD), (EG)

Pregunta 132

Pregunta
The minimum cost of path from A node to I node by the following graph:
Respuesta
  • 19
  • 10
  • 16
  • 26

Pregunta 133

Pregunta
Add element “K” in the following max heap: g,c,f,b,a,d
Respuesta
  • None of them
  • c,g,b,a,d,f,k
  • k,c,g,b,a,d,f
  • c,g,b,a,k,d,f

Pregunta 134

Pregunta
Translate the following expression tree graph into the mathematical equation that it represents.26. Translate the following expression tree graph into the mathematical equation that it represents.
Respuesta
  • (2+3)*(4-1) = 15
  • (3+2)*(4-1) = 15
  • (3+2)*(4-1) = 16
  • (3+2)*(1-4) = 15

Pregunta 135

Pregunta
Find the cost of MST in the graph below:
Respuesta
  • 47
  • 36
  • 46
  • 50

Pregunta 136

Pregunta
Consider the undirected graph below: Using Prim's algorithm to construct a minimum spanning tree starting with node A, which one of the following sequences of edges represents a possible order in which the edges would be added to construct the minimum spanning tree?
Respuesta
  • (A, D), (A, B), (A, C), (C, F), (G, E), (F, G)
  • (A, B), (A, D), (D, F), (F, G), (G, E), (F, C)
  • (E, G), (C, F), (F, G), (A, D), (A, B), (A, C)
  • (A, D), (A, B), (D, F), (F, C), (F, G), (G, E)

Pregunta 137

Pregunta
Find the minimum path from a to i Dijkstra algorithm. Choose the sequence of visited Nodes.
Respuesta
  • a->c->d->b->e->g->
  • a->c->g->b->e->d->
  • a->c->d->b->g->e->
  • a->d->g->b->e->

Pregunta 138

Pregunta
What is the run-time complexity of the Floyd-Warshall algorithm?(best case performance)
Respuesta
  • O(V*E)
  • O(V+E)
  • O(V^3)
  • O(V^2)

Pregunta 139

Pregunta
The Dijkstra and the Bellman-Ford algorithms both determine
Respuesta
  • the shortest path between all nodes in a graph
  • the shortest path between two nodes in a graph
  • whether a graph is directed or undirected
  • the edge with the greatest weight in a graph
  • whether or not a graph is a tree

Pregunta 140

Pregunta
Choose the algorithm with not-greedy approach
Respuesta
  • Prim Algorithm
  • Floyd Algorithm
  • Dijkstra Algorithm
  • Kruskal Algorithm

Pregunta 141

Pregunta
Having parenthesis in an expression tree serves to balance it better.
Respuesta
  • True
  • False

Pregunta 142

Pregunta
What are two operators for accessing members of a structure and when are they used?
Respuesta
  • . and->
  • . and this
  • None
  • . and--->

Pregunta 143

Pregunta
\ What is the difference between a and a+ modes?
Respuesta
  • a - open for appending, a+ - open for reading and appending
  • a - open for reading and appending, a+ - open for appending
  • a -open for appending, a+ - open for reading and writing
  • a - open for appending, a+ - open for writing and appending

Pregunta 144

Pregunta
The nodes of a ______linked list can be traversed_____.
Respuesta
  • Singly, forward and backward
  • Doubly, forward only
  • Doubly, backward only
  • Singly, forward only

Pregunta 145

Pregunta
A hash table of length 10 uses double hashing and hash function h(k)=k mod 10. After inserting 6 values into an empty hash table, the table is as shown Which one of the following choices gives a possible order in which the key values could have been inserted in the table?
Respuesta
  • 34,52,42,23,33,46
  • 33,46,42,34,52,23
  • 46,34,42,23,52,33
  • 42,46,33,23,34,52

Pregunta 146

Pregunta
What is the formula to calculate the load factor of hash table? (n number of elements, m size of table)
Respuesta
  • ɻ= n/m
  • ɻ =n*m
  • ɻ =n/sqrt(m)
  • ɻ =n/m^2

Pregunta 147

Pregunta
Which of the following is a balanced tree for the numbers 1-9? There may be more than one answer.

Pregunta 148

Pregunta
What are algorithms appropriate to find the minimum spanning tree?What are algorithms appropriate to find the minimum spanning tree? Выберите один или несколько ответов:
Respuesta
  • Prim algorithm
  • Floyd algorithm
  • Bellman-Ford algorithm
  • Kruskal's algorithm

Pregunta 149

Pregunta
The approach helps to balance tree (One or multiple)
Respuesta
  • AVL
  • BST
  • Red Black Tree
  • none

Pregunta 150

Pregunta
String in C (One or multiple)
Respuesta
  • char* name;
  • char name[4] = “Hello”;
  • none
  • char name[10];

Pregunta 151

Pregunta
String in C programming language… (One or multiple)
Respuesta
  • char name[6] = “Ernur”;
  • char name[5] = “Ernur”;
  • char* name = “Ernur”;
  • char name;

Pregunta 152

Pregunta
Identify the C compiler in UNIX like operating systems. (One or multiple)
Respuesta
  • vc++
  • cc
  • Borland
  • gcc
Mostrar resumen completo Ocultar resumen completo

Similar

Inglés - Verbos Compuestos I (Phrasal Verbs)
maya velasquez
Test sobre la Organización del Estado de Los Reyes Católicos
maya velasquez
tipos de herramientas
arturo.garrido_2
Examen Primer trimestre
jorgeluisparedes
5 Pasos para el Éxito en el Aprendizaje_2
Diego Santos
Vocabulario Inglés - Tema 2
tanianicolasizqu
ORGANIGRAMA
Sebastian Valencia
Cómo crear un Mapa Mental
gladis_lomeli
Terrestrial Ecosystems
Francisco Alcaraz López
Las ondas sonoras
mariajesus camino
Test Estructuras IV: Tipo de estructuras
Pedro Landín