Edited, memorised or added to reading list

on 31-Oct-2018 (Wed)

Do you want BuboFlash to help you learning these things? Click here to log in or create user.

Flashcard 3510253784332

Question
In Linux, when email is received for you (from another user on the same machine or from a user from another machine) it is appended to the file: [...] /<username>
Answer
/var/spool/mail
^^ note that spool means a cylindrical device on which film/magnetic tape/other flexible materials can be wound


statusnot learnedmeasured difficulty37% [default]last interval [days]               
repetition number in this series0memorised on               scheduled repetition               
scheduled repetition interval               last repetition or drill
10. Mail
m like Bruce Wallaby <bruce@kangeroo.co.au> or bruce@kangeroo.co.au (Bruce Wallaby) . In this case, the surrounding characters are purely cosmetic; only bruce@kangeroo.co.au is ever used. <span>When mail is received for you (from another user on the system or from a user from another system) it is appended to the file /var/spool/mail/<username> called the mail file or mailbox file; <username> is your login name. You then run some program that interprets your mail file, allowing you to browse the file as a sequence of mail messages and read a







Flashcard 3511437626636

Question
In algorithms, a queue can be more effieciently implemented as two stacks (when enqueue vs dequeue is evenly distributed) compared to a single linked list, by having an [...] stack and a [...] stack (note: each occlusion is a different word)
Answer
insert stack AND remove/delete stack


statusnot learnedmeasured difficulty37% [default]last interval [days]               
repetition number in this series0memorised on               scheduled repetition               
scheduled repetition interval               last repetition or drill

pdf

cannot see any pdfs







Flashcard 3511488220428

Question
In algorithms, what is the characteristic that makes a binary tree, a Binary Search Tree (BST)?
Answer
In a BST, for a given node with a value, all the nodes in the left sub-tree are less than or equal to the value of that node, and all the nodes in the right sub-tree of this node are greater than the value of that node.


statusnot learnedmeasured difficulty37% [default]last interval [days]               
repetition number in this series0memorised on               scheduled repetition               
scheduled repetition interval               last repetition or drill

pdf

cannot see any pdfs







Flashcard 3511505259788

Question
In algorithms, for a Binary Search Tree how do you find the node with smallest value?
Answer
You find the left most node by starting from the root node as being current node and keep making the left child the new current node, until there is no more left child, that last node is then the node with lowest value.


statusnot learnedmeasured difficulty37% [default]last interval [days]               
repetition number in this series0memorised on               scheduled repetition               
scheduled repetition interval               last repetition or drill

pdf

cannot see any pdfs







Flashcard 3511508405516

Question
In algorithms, for a Binary Search Tree how do you find the node with largest value?
Answer
You find the right most node by starting from the root node as being current node and keep making the right child the new current node, until there is no more right child, that last node is then the node with largest value.


statusnot learnedmeasured difficulty37% [default]last interval [days]               
repetition number in this series0memorised on               scheduled repetition               
scheduled repetition interval               last repetition or drill

pdf

cannot see any pdfs







Flashcard 3511511551244

Question
In algorithms, the time complexity to find the minimum or maximum value in a Binary Search Tree is [...]
Answer
O(h), where h is height of tree.


statusnot learnedmeasured difficulty37% [default]last interval [days]               
repetition number in this series0memorised on               scheduled repetition               
scheduled repetition interval               last repetition or drill

pdf

cannot see any pdfs







Flashcard 3511522299148

Question
In algorithms, when you are implementing Binary Tree functionality, you create a BinaryTree class, and an underlying [...] class, which is used in (and its inner workings abstracted away in) the BinaryTree class.
Answer
Node


statusnot learnedmeasured difficulty37% [default]last interval [days]               
repetition number in this series0memorised on               scheduled repetition               
scheduled repetition interval               last repetition or drill

pdf

cannot see any pdfs







Flashcard 3511526231308

Question
In algorithms/python, when implementing Binary Tree functionality, you do so via the below Tree class, as well as the underlying Node class. Defince the Node class.
class Tree:
    def __init__(self):
        self.root = None
...
...
Answer
class Node:
    def __init__(self, data):
        self.data = data
        self.left_child = None
        self.right_child = None


statusnot learnedmeasured difficulty37% [default]last interval [days]               
repetition number in this series0memorised on               scheduled repetition               
scheduled repetition interval               last repetition or drill

pdf

cannot see any pdfs







Flashcard 3511530163468

Question
In algorithms/python, when implementing Binary Tree functionality, you do so via the BinaryTree class, as well as the underlying Node class. Defince the BinaryTree class (class signature and constructor only) given the underlying Node class below:
class Node:
    def __init__(self, data):
        self.data = data
        self.left_child = None
        self.right_child = None

Answer
class BinaryTree:
    def __init__(self):
        self.root = None
[default - edit me]


statusnot learnedmeasured difficulty37% [default]last interval [days]               
repetition number in this series0memorised on               scheduled repetition               
scheduled repetition interval               last repetition or drill

pdf

cannot see any pdfs







Flashcard 3511534882060

Question
In algorithms/python, for Binary Search Trees, given the below class definitions for Node and Tree class, complete the find_min function to return the node which has the minimum value in the BST:
class Node:        
    def __init__(self, data):            
        self.data = data
        self.right_child = None
        self.left_child = None


class Tree:        
    def __init__(self):            
        self.root = None

    # returns pointer to node with min value  
    def find_min(self):
    ####  IMPLEMENT THIS FUNCTION BODY #####
 
Answer
    def find_min(self):
        current = self.root
        while current and current.left_child:
            current = current.left_child
        return current
^^^ the algorithm for above function is basically based on fact that in BST, by design, the smallest value is the left most node (just like the largest is right most node)
^^^ note that the "while current" part of "while current and current.left_child) is there to take care of case that self.root is None


statusnot learnedmeasured difficulty37% [default]last interval [days]               
repetition number in this series0memorised on               scheduled repetition               
scheduled repetition interval               last repetition or drill

pdf

cannot see any pdfs