Lecture 13, 14, 15

 0    21 kartičky    kapi2304
stáhnout mp3 Vytisknout hrát zkontrolovat se
 
otázka język polski odpověď język polski
Graphs have vertices (nodes) connected by edges: G = (V, E)
začněte se učit
True
A graph that contains a cycle is a tree
začněte se učit
false
Properties of free trees:
začněte se učit
Any two vertices in a free tree are connected by a unique path, If a single edge is removed from a free tree, it becomes disconnected; If any edge is added to a free tree, it becomes a graph with a cycle (no longer a tree)
A binary tree T is a structure defined on a finite set of nodes that either - contains no nodes, or - is composed of three disjoint sets of nodes:
začněte se učit
A binary tree called right subtree, A root node, A binary tree called left subtree
Consider the original array 17, 8, 12, 4, 26. How many comparisons are needed to construct the BST on the original array?
začněte se učit
10
In binary tree sort, we first construct the BST and then we perform _______ traversal to get the sorted order.
začněte se učit
inorder
What is the worst case time complexity of the binary tree sort?
začněte se učit
O(n^2)
What is the best case time complexity of the binary tree sort?
začněte se učit
O(nlogn)
Binary tree sort is an in-place sorting algorithm.
začněte se učit
False
Which of the following sorting algorithms can be considered as improvement to the binary tree sort?
začněte se učit
Heap sort
What is the time complexity to count the number of elements in the linked list?
začněte se učit
O(n)
Which of the following points is/are true about Linked List data structure when it is compared with array
začněte se učit
It is easy to insert and delete elements in Linked List; Random access is not allowed in a typical implementation of Linked Lists
Which of the following sorting algorithms can be used to sort a random linked list with minimum time complexity?
začněte se učit
Merge Sort
In the worst case, the number of comparisons needed to search a singly linked list of length n for a given element is
začněte se učit
n
What are the time complexities of finding 8th element from beginning and 8th element from end in a singly linked list? Let n be the number of nodes in linked list, you may assume that n > 8.
začněte se učit
O(1) and O(n)
Why do we impose restrictions like - root property is black - every leaf is black - children of red node are black - all leaves have same black
začněte se učit
to get logarithm time complexity
What are the operations that could be performed in O(logn) time complexity by red-black tree?
začněte se učit
insertion, deletion, finding predecessor, successor
Which of the following is an application of Red-black trees and why?
začněte se učit
can be used in process schedulers, maps, sets
How can you save memory when storing color information in Red-Black tree?
začněte se učit
using least significant bit of one of the pointers in the node for color information
What is the special property of red-black trees and what root should always be?
začněte se učit
a color which is either red or black and root should always be black color only
Which of the following points is/are true about Linked List data structure when it is compared with array
začněte se učit
The size of array has to be pre-decided, linked lists can change their size any time; Arrays have better cache locality that can make them better in terms of performance.

Chcete-li přidat komentář, musíte se přihlásit.