# on 30-Oct-2018 (Tue)

#### Flashcard 3433773534476

Question
In linux, sed [...] 's/e/E/g' test.txt, will replace all occurences of e with E in file test.txt and print results to stdout (i.e. not changing original test.txt file).
-e

status measured difficulty not learned 37% [default] 0
8. Streams and sed -- The Stream Editor
rence in the same line (usually sed just replaces the first occurrence of the regular expression in each line). (There are other <option> ; see the sed info page.) For demonstration, type <span>sed -e 's/e/E/g' and type out a few lines of English text. 8.7 Regular Expression Subexpressions The section explains how to do the apparently complex task of moving text around within lines. Consider,

#### Flashcard 3503695990028

Question
In algorithms, stacks and queues are special types of [...] data structures.

status measured difficulty not learned 37% [default] 0

#### pdf

cannot see any pdfs

#### Flashcard 3503730855180

Question
In algorithms/python, you can use a list to implement a queue (although effeciency is not optimal), and to add an item you do list. [...] , and to delete an item you do list. [...] , one is O(1) while the other is O(n).
^^ NOTE: the two occlusions above are each a different answer!
list.pop(0) to dequeue/delete

status measured difficulty not learned 37% [default] 0

#### pdf

cannot see any pdfs

#### Flashcard 3503737146636

Question
In algorithms, a queue can be implemented as a single linked list of nodes (although not of optimal efficiently due to the slow delete), as long as you 1) [...] and 2) each node points to the item in front of it in the queue.
keep a pointer to the end of the queue

status measured difficulty not learned 37% [default] 0

#### pdf

cannot see any pdfs

#### Flashcard 3503741078796

Question
In algorithms, a queue can be implemented as a single linked list of nodes (although not of optimal efficiently due to the slow delete), as long as you 1) keep a pointer to the end of the queue and 2) [...]
each node points to the item in front of it in the queue.

status measured difficulty not learned 37% [default] 0

#### pdf

cannot see any pdfs

#### Annotation 3511404334348

 Dans ce sens, le problème constitue moins un obstacle à contourner, qu’un élément déclencheur dans le processus d’apprentissage

#### pdf

cannot see any pdfs

#### Flashcard 3511406693644

Question
Dans ce sens, le problème constitue moins un obstacle à contourner, qu’un élément déclencheur dans le processus [...]
d’apprentissage

status measured difficulty not learned 37% [default] 0

#### Parent (intermediate) annotation

Open it
Dans ce sens, le problème constitue moins un obstacle à contourner, qu’un élément déclencheur dans le processus d’apprentissage

#### Original toplevel document (pdf)

cannot see any pdfs

#### Flashcard 3511408266508

Question
Dans ce sens, le [...] constitue moins un obstacle à contourner, qu’un élément déclencheur dans le processus d’apprentissage
problème

status measured difficulty not learned 37% [default] 0

#### Parent (intermediate) annotation

Open it
Dans ce sens, le problème constitue moins un obstacle à contourner, qu’un élément déclencheur dans le processus d’apprentissage

#### Original toplevel document (pdf)

cannot see any pdfs

#### Flashcard 3511423733004

Question
In linux, sed [...] 's/e/E/g' test.txt, will replace all occurences of e with E in file test.txt (i.e. nothing is sent to stdout but the content of test.txt itself are changed).
-i

status measured difficulty not learned 37% [default] 0

#### Flashcard 3511434480908

Question
In algorithms, for implementing a queue, instead of using a single linked list (which is slow on dequeue), a more effecient implementation (when enque and deques happen at the same rate) is using [...] (<-- could be more than one word:))
two stacks
^^ by adding all incoming items to an Insert stack, and removing from the Remove stack (if remove stack is empty, add all
items from insert stack to it one at a time, which preserves the queue order).

status measured difficulty not learned 37% [default] 0

#### pdf

cannot see any pdfs

#### 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)
insert stack AND remove/delete stack

status measured difficulty not learned 37% [default] 0

#### pdf

cannot see any pdfs

#### Flashcard 3511440772364

Question
In algorithms, a queue can be more efiecntly implemented as two stacks (compared to a single linked list implementation), by [...] (<-- use multi-word description here) an Insert stack, and removing from the Remove stack (if remove stack is empty, add all items from insert stack to it one at a time).
adding all incoming items to (using simple list.append(item) )

status measured difficulty not learned 37% [default] 0

#### pdf

cannot see any pdfs

#### Flashcard 3511444704524

Question
In algorithms, you create a queue (more efficiently than a single linked list) from two stacks, by always adding items to a Insert stack, and removeing items from a Remove stack, how?
Remove from top of remove stack (list.pop()). If remove stack is empty, add all items from insert stack to it one at a time (since items will be added in reverse order, remove order is kept in tact!), then do the pop()

status measured difficulty not learned 37% [default] 0

#### pdf

cannot see any pdfs

#### Flashcard 3511454141708

Question
In algorithms/python, the most effecient implementation of a queue (more effiecient than using python list), where both enqueue and dequeue is O(1), is using a [...] (<-- use multi-word description here)

status measured difficulty not learned 37% [default] 0

#### pdf

cannot see any pdfs

#### Flashcard 3511458073868

Question
In algorithms, the most effecient implementation of a queue is a double linked list (i.e. O(1) on both enqueue and dequque), implemented by 1) [..use multi-word description here...] 2) having each node point to the person behind and infront of it in the queue.
having pointers to both the back and front of the queue

status measured difficulty not learned 37% [default] 0

#### pdf

cannot see any pdfs

#### Flashcard 3511461219596

Question
In algorithms, the most effecient implementation of a queue is a double linked list (i.e. O(1) on both enqueue and dequque), implemented by 1) having pointers to both the back and front node of the queue 2) [...use multi-word description here...]
having each node in the queue point to the person behind and infront of it in the queue.

status measured difficulty not learned 37% [default] 0

#### pdf

cannot see any pdfs

#### Flashcard 3511464365324

Question
In algorithms, the most effecient implementation of a queue is a double linked list, implemented by having a Queue class, with [...] and [...] methods, as well as properties to point to back and front of the queue, and Node class that implements the nodes in the queue (each node having pointers to node in front and behind it in the queue)
enqueue and dequeue

status measured difficulty not learned 37% [default] 0

#### pdf

cannot see any pdfs

#### Flashcard 3511467511052

Question
In python, if you want to generate a random number (between for example 1 and 10), you would use the [...] method from the random module
randint

status measured difficulty not learned 37% [default] 0

#### pdf

cannot see any pdfs

#### Flashcard 3511470656780

Question
In python, if you want to generate a random number (between for example 1 and 10), you would use the randint method from the [...] module
random

status measured difficulty not learned 37% [default] 0

#### pdf

cannot see any pdfs

#### Flashcard 3511473802508

Question
In python, complete the following code to print out a random number between 1 and 10, inclusive:

from random import randint
print [...]
randint(1,10)

status measured difficulty not learned 37% [default] 0

#### pdf

cannot see any pdfs

#### Flashcard 3511476948236

Question
In python, write code to sleep for 10 seconds (hint: it is 2 lines of code).
from time import sleep
sleep(10)

status measured difficulty not learned 37% [default] 0

#### pdf

cannot see any pdfs

#### Flashcard 3511480093964

Question
In algorithms, a [...] is a hierarchical form of data structure where there is a distinct (i.e. easily recognizable/distinguishable) parent-child relationship between the items
tree

status measured difficulty not learned 37% [default] 0

#### pdf

cannot see any pdfs

#### Flashcard 3511484026124

Question
In algorithms, a [...] tree is one in which each node has a maximum of two children.
binary

status measured difficulty not learned 37% [default] 0

#### pdf

cannot see any pdfs

#### Flashcard 3511488220428

Question
In algorithms, what is the characteristic that makes a binary tree, a Binary Search Tree (BST)?
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.

status measured difficulty not learned 37% [default] 0

#### pdf

cannot see any pdfs