sdp4

Description

SDP4 Quiz on sdp4, created by Csse 1502 on 21/05/2017.
Csse 1502
Quiz by Csse 1502, updated more than 1 year ago
Csse 1502
Created by Csse 1502 over 7 years ago
979
1

Resource summary

Question 1

Question
Re-balancing of AVL tree costs
Answer
  • O(logn)
  • O(nlogn)
  • O(1)
  • O(n)

Question 2

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

Question 3

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

Question 4

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

Question 5

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

Question 6

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

Question 7

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

Question 8

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

Question 9

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

Question 10

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

Question 11

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

Question 12

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

Question 13

Question
The MST of the graph below:
Answer
  • 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

Question 14

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

Question 15

Question
Choose the algorithm with not greedy approach ….
Answer
  • Prim Algorithm
  • Dijkstra Algorithm
  • Floyd Algorithm
  • Kruskal Algorithm

Question 16

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

Question 17

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

Question 18

Question
The following heap : 18 15 9 14 11 2 7 6 12 3, add there 17 and choose right sequence:
Answer
  • 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

Question 19

Question
In the deletion operation of max heap, the root is replaced by:
Answer
  • 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

Question 20

Question
Delete max element from the heap and choose the answer: 18 17 9 14 15 2 7 6 12 3 11
Answer
  • 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

Question 21

Question
In a min heap
Answer
  • 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

Question 22

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

Question 23

Question
Please find the postfix expression from prefix: - * - + a b c / e f - g / h i
Answer
  • 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 / - -

Question 24

Question
If this tree is used for sorting, then new no 8 should be placed as the
Answer
  • 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

Question 25

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

Question 26

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

Question 27

Question
Which of the following statements about binary trees is true?
Answer
  • 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.

Question 28

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

Question 29

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

Question 30

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

Question 31

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

Question 32

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

Question 33

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

Question 34

Question
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?
Answer
  • B
  • C
  • D
  • A

Question 35

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

Question 36

Question
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
Answer
  • C
  • B
  • D
  • A

Question 37

Question
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
Answer
  • a-q, b-p, c-p
  • a-p, b-p, c-p
  • a-r, b-q, c-p
  • a-p, b-r, c-q

Question 38

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

Question 39

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

Question 40

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

Question 41

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

Question 42

Question
Heap is an example of
Answer
  • BST
  • Complete BST
  • Spanning tree
  • General tree

Question 43

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

Question 44

Question
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
Answer
  • O(n/d)
  • O(n*d)
  • O(d)
  • O(n)

Question 45

Question
Which of the following statements is true of both depth-first and breadth-first searches?
Answer
  • 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.

Question 46

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

Question 47

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

Question 48

Question
A full binary tree n leaves contains
Answer
  • n nodes,
  • 2n-1 nodes
  • n nodes
  • 2n nodes

Question 49

Question
Which one of the following array represents a binary max-heap?
Answer
  • 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

Question 50

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

Question 51

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

Question 52

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

Question 53

Question
Choose the trasitive closure for the graph below
Answer
  • 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

Question 54

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

Question 55

Question
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?
Answer
  • P, S, R, U
  • P, Q, S, U
  • P, Q, R, U
  • P, Q, R, S, U

Question 56

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

Question 57

Question
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; }
Answer
  • The code prints all ASCII values and its characters
  • Error: x undeclared identifier
  • The code generates an infinite loop
  • Error: while statement missing

Question 58

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

Question 59

Question
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; }
Answer
  • 30
  • 500
  • 200
  • 100

Question 60

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

Question 61

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

Question 62

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

Question 63

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

Question 64

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

Question 65

Question
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?
Answer
  • A
  • B
  • D
  • C

Question 66

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

Question 67

Question
Stack works by the principle
Answer
  • LILO
  • FIFO
  • LIFO
  • FILO

Question 68

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

Question 69

Question
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.
Answer
  • 42,46,33,23,34,52
  • 46,42,34,52,23,33
  • 34,42,23,52,33,46
  • 46,34,42,23,52,33

Question 70

Question
An algorithm is
Answer
  • 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

Question 71

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

Question 72

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

Question 73

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

Question 74

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

Question 75

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

Question 76

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

Question 77

Question
What is touch command in Unix OS?
Answer
  • 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

Question 78

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

Question 79

Question
The default executable generation on Unix for a C program is
Answer
  • a.exe
  • default.out
  • a.out
  • out.a

Question 80

Question
In the given below statement,what does the “arr” indicate? char *arr[30];
Answer
  • 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

Question 81

Question
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; }
Answer
  • clean k;
  • delete k;
  • free(k);
  • memfree(k);

Question 82

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

Question 83

Question
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; }
Answer
  • #include <ctype.h>
  • #include <math.h>
  • #include <string.h>
  • #include <stdlib.h>

Question 84

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

Question 85

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

Question 86

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

Question 87

Question
A doubly linked list performs traversal in____
Answer
  • none
  • either direction
  • circular direction
  • any direction

Question 88

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

Question 89

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

Question 90

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

Question 91

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

Question 92

Question
What is make command in Unix OS?
Answer
  • 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

Question 93

Question
What is ls command in UNIX OS?
Answer
  • 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

Question 94

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

Question 95

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

Question 96

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

Question 97

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

Question 98

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

Question 99

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

Question 100

Question
Queue can be implemented using a list
Answer
  • Верно
  • Неверно

Question 101

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

Question 102

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

Question 103

Question
Unix command pwd_____
Answer
  • 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

Question 104

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

Question 105

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

Question 106

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

Question 107

Question
A local variable is stored in __
Answer
  • heap segment
  • stack segment
  • code segment
  • none

Question 108

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

Question 109

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

Question 110

Question
Only top element can be accessed in stack
Answer
  • верно
  • неверно

Question 111

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

Question 112

Question
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?
Answer
  • 46, 42, 34, 52, 23, 33
  • 34, 42, 23, 52, 33, 46
  • 42, 23, 34, 52, 46, 33
  • 46, 34, 42, 23, 52, 33

Question 113

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

Question 114

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

Question 115

Question
Queue works by the principle
Answer
  • Last in First out
  • none
  • First in First out FIFO
  • First in Last out

Question 116

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

Question 117

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

Question 118

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

Question 119

Question
Linked list works by the FIFO method
Answer
  • верно
  • неверно

Question 120

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

Question 121

Question
What is the general formula for double hashing in the hast table?
Answer
  • 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

Question 122

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

Question 123

Question
Identify the incorrect file opening mode from the following
Answer
  • r
  • x
  • w
  • a

Question 124

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

Question 125

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

Question 126

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

Question 127

Question
Recursion uses more memory space than iteration because
Answer
  • 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

Question 128

Question
Shell sort uses
Answer
  • quick sort
  • insertion sort
  • selection sort
  • merge sort

Question 129

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

Question 130

Question
What is the maximum number of nodes that a perfectly balanced tree with a height of 7 can contain?
Answer
  • (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)

Question 131

Question
Find the MST from the graph below:
Answer
  • (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)

Question 132

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

Question 133

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

Question 134

Question
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.
Answer
  • (2+3)*(4-1) = 15
  • (3+2)*(4-1) = 15
  • (3+2)*(4-1) = 16
  • (3+2)*(1-4) = 15

Question 135

Question
Find the cost of MST in the graph below:
Answer
  • 47
  • 36
  • 46
  • 50

Question 136

Question
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?
Answer
  • (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)

Question 137

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

Question 138

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

Question 139

Question
The Dijkstra and the Bellman-Ford algorithms both determine
Answer
  • 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

Question 140

Question
Choose the algorithm with not-greedy approach
Answer
  • Prim Algorithm
  • Floyd Algorithm
  • Dijkstra Algorithm
  • Kruskal Algorithm

Question 141

Question
Having parenthesis in an expression tree serves to balance it better.
Answer
  • True
  • False

Question 142

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

Question 143

Question
\ What is the difference between a and a+ modes?
Answer
  • 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

Question 144

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

Question 145

Question
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?
Answer
  • 34,52,42,23,33,46
  • 33,46,42,34,52,23
  • 46,34,42,23,52,33
  • 42,46,33,23,34,52

Question 146

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

Question 147

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

Question 148

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

Question 149

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

Question 150

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

Question 151

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

Question 152

Question
Identify the C compiler in UNIX like operating systems. (One or multiple)
Answer
  • vc++
  • cc
  • Borland
  • gcc
Show full summary Hide full summary

Similar

Spanish Vocabulary- Beginner
PatrickNoonan
Romeo and Juliet: Act by Act
PatrickNoonan
George- Of mice and men
Elinor Jones
Revolutions and Turmoil: Russia 1905-1917
Emily Faul
CITAÇÕES DE GRANDES FILÓSOFOS
miminoma
Macbeth Notes
Bella Ffion Martin
USA and Vietnam (1964-1975) - Part 1
Lewis Appleton-Jones
HRCI Glossary of Terms O-Z
Sandra Reed
Key word flashcards
I M Wilson
Language Techniques
Anna Wolski
Část 3.
Gábi Krsková