Complete the implementation of the binary search tree started in class. You know you are done
when the main function runs correctly with all commented lines uncommented, and printing
shows the expected behavior of a BST.
CODE:
# TODO: implement inorder
# TODO: implement find
# TODO: implement maximum, minimum
# TODO: implement successor, predecessor
# TODO: implement delete
def main():
bst = Node(3, None)
for k in [5, 7, 4, 5, 6]:
bst.insert(k)
# print(bst.inorder())
# for k in [4, 3, 6, 2, 1, 7]:
# print(\"find {}: {}\".format(k, bst.find(k) != None))
# for k in [4,3, 2]:
# n = bst.find(k)
# if n != None:
# s = n.successor()
# print(\"successor of {}: {}\".format(k, s.key if s != None else None))
# s = n.predecessor()
# print(\"predecessor of {}: {}\".format(k, s.key if s != None else None))
# s = n.delete()
# print(\"deleted {}\".format(s.key))
# print(bst.inorder())
class Node:
def __init__(self, key, parent):
self.key = key # self is Python for \"this\"
self.parent = parent
self.left = None
self.right = None
def inorder(self):
\'\'\'returns list of the keys in an inorder traversal of the tree rooted at self\'\'\'
# TODO: replace \"pass\" keyword with actual code
# Hint: li.append(value) appends a value to list li
# Hint: li = list1 + list2 returns the concatnenation of list1 and list2
# Hint: use dot notation to call method: inorder(node) ---> node.inorder()
# To test: uncomment line 10 and click \"Run\"
li = [] # empty list
if self.left is not None:
pass
pass
if self.right is not None:
pass
return li
def insert(self, key):
\'\'\'inserts a new node with given key into subtree rooted at self node\'\'\'
if key < self.key:
if self.left is None: # None is Python for null, \"is\" = \"==\", \"is not\" = \"!=\"
self.left = Node(key, self)
else:
self.left.insert(key)
else:
if self.right is None:
self.right = Node(key, self)
else:
self.right.insert(key)
def find(self, key):
\'\'\'returns a node in the subtree rooted at self with this key or
None if no such key exists\'\'\'
# Hint: similar to insert()
# Test: uncomment lines 11 and 12, click \"Run\"
pass
def minimum(self):
\'\'\'returns the node with minimum key in the subtree rooted at self\'\'\'
pass
def maximum(self):
\'\'\'returns the node with maximum key in the is subtree rooted at self\'\'\'
pass
def successor(self):
\'\'\'returns successor of the self node or None if it does not have one\'\'\'
# TODO: fill the if statement
if self.right is not None:
pass
c, p = self, self.parent
while p is not None and c is p.right:
c, p = p, p.parent
return p
def predecessor(self):
\'\'\'returns the predecessor of the self node or None if it does not have one\'\'\'
pass
def delete(self):
\'\'\'deletes the self node from the tree and returns that node\'\'\'
parent, left, right = self.parent, self.left, self.right
# case 0: no children
if left is None and right is None:
if parent is not None:
if self is parent.left:
parent.left = None
else:
parent.right = None
return self
# case 1: one or two children, no pa.
spell checker with python 3
How it works ?
Main.py is the main file , Spell checker checks the entered word or phrase and if it's wrong it suggests alternative words .
The project on GitHub:
https://github.com/amrelarabi/spell-checker-with-python-3/
For more information you can visit :
http://www.motwr.com/2017/03/python3-spell-checker.html
import os import matplotlib-pyplot as plt import pandas as pd import r.docxBlake0FxCampbelld
import os
import matplotlib.pyplot as plt
import pandas as pd
import random
import string
from numpy.random import default_rng
import datetime
def run(low=None, high=None, number_values=None):
"""
'main' function for hw1 lecture
creates some data then saves it in a folder
"""
# User enters low, high, n integer
print("Creating random data.")
if type(low) != int:
while(True):
low = input("Please enter lowest possible value as integer:\n")
low_int = confirm_integer(low)
if low_int:
break
else:
continue
else:
low_int = low
if type(high) != int:
while(True):
high = input("Please enter highest possible value as integer:\n")
high_int = confirm_integer(high)
if high_int:
break
else:
continue
else:
high_int = high
if type(number_values) != int:
while(True):
n = input("Please enter number of values to create:\n")
n_int = confirm_integer(n)
if n_int:
break
else:
continue
else:
n_int = number_values
random_df = make_random_df(low_int, high_int, n_int)
# make output dir
local_dir = os.getcwd()
output_dir = os.path.join(local_dir, "Random_Files") # complete path to new folder
try:
os.mkdir(output_dir) # make folder
except FileExistsError:
pass # Do nothing if folder exists
output_df_os_mod_examples(random_df, output_dir)
def confirm_integer(input_val):
"""
Converts input val to integer, returns False if exception
:param input_val:
:return: integer or False
"""
try:
convert_int = int(input_val)
except Exception as e:
print("invalid integer")
return False
return convert_int
def make_random_df(lower_int, upper_int, number_idx):
"""
Creates Random DataFrame from bounds [lower_int, upper_int].
Creates 5 column DataFrame [Integers, Floads, Random Ascii (Ul#), Random Ascii (l), Random Ascii (U#)] number_idx rows
:param lower_int: lower bounds for random integers
:param upper_int: upper bounds for random integers
:param number_idx: number of random_df index
:return: rand_df: Pandas Dataframe (5 cols) number_idx rows
"""
# create n random data
rng = default_rng()
ints = rng.integers(low=lower_int, high=upper_int, size=number_idx)
floats = ints * rng.random() # multiply integers by random float [0,1]
# create some characters
rand_upper_lower_digit = random.choices(string.ascii_letters + string.digits, k=number_idx)
rand_lower = random.choices(string.ascii_lowercase, k=number_idx)
rand_upper_digit = random.choices(string.ascii_uppercase + string.digits, k=number_idx)
# make dataframe
rand_df_dict = {
"Integers": ints,
"Floats": floats,
"Random Ascii (Ul#)": rand_upper_lower_digit,
"Random Ascii (l)": rand_lower,
"Random Ascii (U#)": rand_upper_digit
}
rand_df = pd.DataFrame.from_dict(rand_df_dict, orient='columns')
return rand_df
def output_df_os_mod_examples(random_df, output_dir):
"""
Output dataframe in many file types.
Examples of os and os.path
:param random_df: pandasDataFrame cols:[Integers, Floads, Random Ascii (Ul#), Random Ascii (l), Random Ascii (U#)]
:param output_dir: path of output folder, exists==True
:return: None
"""
cwd = os.getcwd()
files = os..
spell checker with python 3
How it works ?
Main.py is the main file , Spell checker checks the entered word or phrase and if it's wrong it suggests alternative words .
The project on GitHub:
https://github.com/amrelarabi/spell-checker-with-python-3/
For more information you can visit :
http://www.motwr.com/2017/03/python3-spell-checker.html
import os import matplotlib-pyplot as plt import pandas as pd import r.docxBlake0FxCampbelld
import os
import matplotlib.pyplot as plt
import pandas as pd
import random
import string
from numpy.random import default_rng
import datetime
def run(low=None, high=None, number_values=None):
"""
'main' function for hw1 lecture
creates some data then saves it in a folder
"""
# User enters low, high, n integer
print("Creating random data.")
if type(low) != int:
while(True):
low = input("Please enter lowest possible value as integer:\n")
low_int = confirm_integer(low)
if low_int:
break
else:
continue
else:
low_int = low
if type(high) != int:
while(True):
high = input("Please enter highest possible value as integer:\n")
high_int = confirm_integer(high)
if high_int:
break
else:
continue
else:
high_int = high
if type(number_values) != int:
while(True):
n = input("Please enter number of values to create:\n")
n_int = confirm_integer(n)
if n_int:
break
else:
continue
else:
n_int = number_values
random_df = make_random_df(low_int, high_int, n_int)
# make output dir
local_dir = os.getcwd()
output_dir = os.path.join(local_dir, "Random_Files") # complete path to new folder
try:
os.mkdir(output_dir) # make folder
except FileExistsError:
pass # Do nothing if folder exists
output_df_os_mod_examples(random_df, output_dir)
def confirm_integer(input_val):
"""
Converts input val to integer, returns False if exception
:param input_val:
:return: integer or False
"""
try:
convert_int = int(input_val)
except Exception as e:
print("invalid integer")
return False
return convert_int
def make_random_df(lower_int, upper_int, number_idx):
"""
Creates Random DataFrame from bounds [lower_int, upper_int].
Creates 5 column DataFrame [Integers, Floads, Random Ascii (Ul#), Random Ascii (l), Random Ascii (U#)] number_idx rows
:param lower_int: lower bounds for random integers
:param upper_int: upper bounds for random integers
:param number_idx: number of random_df index
:return: rand_df: Pandas Dataframe (5 cols) number_idx rows
"""
# create n random data
rng = default_rng()
ints = rng.integers(low=lower_int, high=upper_int, size=number_idx)
floats = ints * rng.random() # multiply integers by random float [0,1]
# create some characters
rand_upper_lower_digit = random.choices(string.ascii_letters + string.digits, k=number_idx)
rand_lower = random.choices(string.ascii_lowercase, k=number_idx)
rand_upper_digit = random.choices(string.ascii_uppercase + string.digits, k=number_idx)
# make dataframe
rand_df_dict = {
"Integers": ints,
"Floats": floats,
"Random Ascii (Ul#)": rand_upper_lower_digit,
"Random Ascii (l)": rand_lower,
"Random Ascii (U#)": rand_upper_digit
}
rand_df = pd.DataFrame.from_dict(rand_df_dict, orient='columns')
return rand_df
def output_df_os_mod_examples(random_df, output_dir):
"""
Output dataframe in many file types.
Examples of os and os.path
:param random_df: pandasDataFrame cols:[Integers, Floads, Random Ascii (Ul#), Random Ascii (l), Random Ascii (U#)]
:param output_dir: path of output folder, exists==True
:return: None
"""
cwd = os.getcwd()
files = os..
This talk was part tongue in cheek, part serious, but entirely fun and given twice as a lightning talk - once at Europython & once at the ACCU python uk 05. It presents a generic python like language parser which does actually work. Think of it as an alternative to brackets in Lisp!
C programming. Answer question only in C code Ninth Deletion with B.pdfinfo309708
C programming. Answer question only in C code Ninth: Deletion with Binary Search Tree (20
points) In the ninth part, you will extend the binary search tree in the eighth part to support the
deletion of a node. The deletion of a node is slightly trickier compared to the search and insert in
the eighth The deletion is straightforward if the node to be deleted has only one child. You make
the parent of the node to be deleted point to that child. In this scenario, special attention must be
paid only when the node to be deleted is the root Deleting a node with two children requires
some more work. In this case, you must find the minimum element in the right subtree of the
node to be deleted. Then you insert that node in the place where the node to be deleted was. This
process needs to be repeated to delete the minimum node that was just moved In either case, if
the node to be deleted is the root, you must update the pointer to the root to point to the new root
node Input format: This program takes a file name as argument from the command line. The file
is either blank or contains successive lines of input. Each line contains a character, \'i or \'d\'
followed by a tab and an integer. For each line that starts with \'i\', your program should insert
that number in the binary search tree if it is not already there. If the line starts with a \'s, your
program should search for that value. If the line starts with a \'d\', your program should delete
that value from the tree output format: For each line in the input file, your program should print
the status/result of the operation. For insert and search, the output is the same as in the Eighth
Part: For an insert operation, the program should print either \"inserted\" with a single space
followed by a number the height of the inserted mode in the tree, or \"duplicate\" if the value is
already present in the tree. The height of the root node is 1. For a search, the program should
either print \"present\" followed by the height of the node, or absent\" based on the outcome of
the search. For a delete, the program should print \"success or \"fail\" based on the whether the
value was present or not. Again, as in the Eight Part, your program should print \"error\" (and
nothing else) if the file does not exist or for input lines with improper structure Example
Execution: Lets assume we have a file filel.txt with the following contents: i 5 i 3 i 4 i 1 i 6 i 2 s
1 d 3 s 2 Executing the program in the following fashion should produce the output shown
below:
Solution
// C program to demonstrate delete operation in binary search tree
#include
#include
struct node
{
int key;
struct node *left, *right;
};
// A utility function to create a new BST node
struct node *newNode(int item)
{
struct node *temp = (struct node *)malloc(sizeof(struct node));
temp->key = item;
temp->left = temp->right = NULL;
return temp;
}
// A utility function to do inorder traversal of BST
void inorder(struct node *root)
{
if (root != NULL)
.
Perl6 regular expression ("regex") syntax has a number of improvements over the Perl5 syntax. The inclusion of grammars as first-class entities in the language makes many uses of regexes clearer, simpler, and more maintainable. This talk looks at a few improvements in the regex syntax and also at how grammars can help make regex use cleaner and simpler.
For this homework, you will write a program to create and manipulate.pdfherminaherman
For this homework, you will write a program to create and manipulate a simple linked list. For
each node in the linked list you will generate a random number, create a node that holds that
number, and insert that node into its sorted position in the linked list. Once the nodes are
inserted, you will traverse the list, printing the value held in each node. Then you will clean up
the list (deleting all the nodes) and exit the program. You will also learn about a tool that you can
use to help you check for memory errors in your code.
Specifications:
Define a struct appropriate for holding a random integer. This struct will also contain a \"next\"
pointer to reference a separate instance of the struct.
You may use the typedef keyword to give your struct a separate typename if you wish, but this is
not a requirement.
The program will read command line arguments. The first argument is the program name (as it
will always be) followed by a random number seed, the number of random numbers to generate
and ending with the Maximum Possible Value of the Random numbers generated (i.e. argc
should be 4).
Your program will use a \"dummy node\" for the linked list. In other words, the head of the list
will be an actual node, but the data field in that node will not be used for sorting purposes.
Your program must contain the following functions:
main() (for obvious reasons)
insertNodeSorted() - You may implement this either of two ways.
One way is to use the head of the list as one parameter and the integer value as the second. The
function will allocate memory for the node, initialize it and then insert it in the proper location in
the list.
The other way is to pass the head of the list as one parameter and a previously allocated and
initialized node as the other. The existing node is inserted in the proper location in the list.
printList() - Takes the head of the list as its only parameter, traverses the list, printing out the
data in sorted order.
deleteList() - Takes the head of the list as its only parameter, traverses the list, deleting all nodes.
The basic algorithm of your program is
Use a loop (based upon command line input values) that:
Generates a random number
Prints the number to stdout
Creates a node that contains that random number
Inserts the new node in sorted order into the existing list
Print the sorted linked list
Delete the linked list
You will use a Makefile to compile your program
Solution
#include
#include
#include
struct test_struct
{
int val;
struct test_struct *next;
};
struct test_struct *head = NULL;
struct test_struct *curr = NULL;
struct test_struct* create_list(int val)
{
printf(\"\ creating list with headnode as [%d]\ \",val);
struct test_struct *ptr = (struct test_struct*)malloc(sizeof(struct test_struct));
if(NULL == ptr)
{
printf(\"\ Node creation failed \ \");
return NULL;
}
ptr->val = val;
ptr->next = NULL;
head = curr = ptr;
return ptr;
}
struct test_struct* add_to_list(int val, bool add_to_end)
{
if(NULL == head)
{
retur.
Briefly explain four functions of stems. SolutionFunction of S.pdfsanuoptical
Briefly explain four functions of stems.
Solution
Function of Stems:
1. It helps store water , as in cacti, and the products of photosynthesis, as in the trunk of sago
palm (Metroxylon sagu) and sweet palm (Argenga pinnata) which store large stock of starch
2. Young green stem also performs a minor role in the production of food through the process of
photosynthesis, but in some species (e.g. cactus) the stem is the chief photosynthesizing organ
3. It supports the leaves, flowers and fruits and connect them with roots. In trees and shrubs the
main stem or trunk provides a strong columnar structure from which branches are attached
raising the leaves upward to be expressed more fully to the sun
4. The plant stem serves as a means of asexual reproduction in many species..
AVR was one of the first microcontroller families to use A. on-chip .pdfsanuoptical
AVR was one of the first microcontroller families to use A. on-chip flash memory for program
storage B. one-time programmable ROM, EPROM, or EEPROM C. both A and B
EMBEDDED SYSTEMS is a computer system with a dedicated function within a larger A.
digital and logical system B. mechanical or electrical system C. both A and B An integrated
circuit that contains all the functions of a central processing unit of a computer is A.
Microprocessor B. Microcontroller C. Both A and b A main system bus, ram, rom/flash, and
typically a set of other devices such as a programmable interrupt controller, analog/digital
converters, any number of general purpose 10 devices A. Microcontroller B. Microprocessor
C. None of the above ASSEMBLY LANGUAGE is an assembly (or assembler) language, often
abbreviated asm, is a A. low-level programming language for a computer B. high-level
programming language for a computer A. C. both A and B
Solution
AVR was one of the first micro controller families to use on chipflash memory for program
storage
Embedded syatems are mechanical or electrical syatems
An integrated circuit that has all functions of a cpu is micro processor
Assembler language is low level programming language for a computer
A main system........... Micro processor.
More Related Content
Similar to Complete the implementation of the binary search tree started in cla.pdf
This talk was part tongue in cheek, part serious, but entirely fun and given twice as a lightning talk - once at Europython & once at the ACCU python uk 05. It presents a generic python like language parser which does actually work. Think of it as an alternative to brackets in Lisp!
C programming. Answer question only in C code Ninth Deletion with B.pdfinfo309708
C programming. Answer question only in C code Ninth: Deletion with Binary Search Tree (20
points) In the ninth part, you will extend the binary search tree in the eighth part to support the
deletion of a node. The deletion of a node is slightly trickier compared to the search and insert in
the eighth The deletion is straightforward if the node to be deleted has only one child. You make
the parent of the node to be deleted point to that child. In this scenario, special attention must be
paid only when the node to be deleted is the root Deleting a node with two children requires
some more work. In this case, you must find the minimum element in the right subtree of the
node to be deleted. Then you insert that node in the place where the node to be deleted was. This
process needs to be repeated to delete the minimum node that was just moved In either case, if
the node to be deleted is the root, you must update the pointer to the root to point to the new root
node Input format: This program takes a file name as argument from the command line. The file
is either blank or contains successive lines of input. Each line contains a character, \'i or \'d\'
followed by a tab and an integer. For each line that starts with \'i\', your program should insert
that number in the binary search tree if it is not already there. If the line starts with a \'s, your
program should search for that value. If the line starts with a \'d\', your program should delete
that value from the tree output format: For each line in the input file, your program should print
the status/result of the operation. For insert and search, the output is the same as in the Eighth
Part: For an insert operation, the program should print either \"inserted\" with a single space
followed by a number the height of the inserted mode in the tree, or \"duplicate\" if the value is
already present in the tree. The height of the root node is 1. For a search, the program should
either print \"present\" followed by the height of the node, or absent\" based on the outcome of
the search. For a delete, the program should print \"success or \"fail\" based on the whether the
value was present or not. Again, as in the Eight Part, your program should print \"error\" (and
nothing else) if the file does not exist or for input lines with improper structure Example
Execution: Lets assume we have a file filel.txt with the following contents: i 5 i 3 i 4 i 1 i 6 i 2 s
1 d 3 s 2 Executing the program in the following fashion should produce the output shown
below:
Solution
// C program to demonstrate delete operation in binary search tree
#include
#include
struct node
{
int key;
struct node *left, *right;
};
// A utility function to create a new BST node
struct node *newNode(int item)
{
struct node *temp = (struct node *)malloc(sizeof(struct node));
temp->key = item;
temp->left = temp->right = NULL;
return temp;
}
// A utility function to do inorder traversal of BST
void inorder(struct node *root)
{
if (root != NULL)
.
Perl6 regular expression ("regex") syntax has a number of improvements over the Perl5 syntax. The inclusion of grammars as first-class entities in the language makes many uses of regexes clearer, simpler, and more maintainable. This talk looks at a few improvements in the regex syntax and also at how grammars can help make regex use cleaner and simpler.
For this homework, you will write a program to create and manipulate.pdfherminaherman
For this homework, you will write a program to create and manipulate a simple linked list. For
each node in the linked list you will generate a random number, create a node that holds that
number, and insert that node into its sorted position in the linked list. Once the nodes are
inserted, you will traverse the list, printing the value held in each node. Then you will clean up
the list (deleting all the nodes) and exit the program. You will also learn about a tool that you can
use to help you check for memory errors in your code.
Specifications:
Define a struct appropriate for holding a random integer. This struct will also contain a \"next\"
pointer to reference a separate instance of the struct.
You may use the typedef keyword to give your struct a separate typename if you wish, but this is
not a requirement.
The program will read command line arguments. The first argument is the program name (as it
will always be) followed by a random number seed, the number of random numbers to generate
and ending with the Maximum Possible Value of the Random numbers generated (i.e. argc
should be 4).
Your program will use a \"dummy node\" for the linked list. In other words, the head of the list
will be an actual node, but the data field in that node will not be used for sorting purposes.
Your program must contain the following functions:
main() (for obvious reasons)
insertNodeSorted() - You may implement this either of two ways.
One way is to use the head of the list as one parameter and the integer value as the second. The
function will allocate memory for the node, initialize it and then insert it in the proper location in
the list.
The other way is to pass the head of the list as one parameter and a previously allocated and
initialized node as the other. The existing node is inserted in the proper location in the list.
printList() - Takes the head of the list as its only parameter, traverses the list, printing out the
data in sorted order.
deleteList() - Takes the head of the list as its only parameter, traverses the list, deleting all nodes.
The basic algorithm of your program is
Use a loop (based upon command line input values) that:
Generates a random number
Prints the number to stdout
Creates a node that contains that random number
Inserts the new node in sorted order into the existing list
Print the sorted linked list
Delete the linked list
You will use a Makefile to compile your program
Solution
#include
#include
#include
struct test_struct
{
int val;
struct test_struct *next;
};
struct test_struct *head = NULL;
struct test_struct *curr = NULL;
struct test_struct* create_list(int val)
{
printf(\"\ creating list with headnode as [%d]\ \",val);
struct test_struct *ptr = (struct test_struct*)malloc(sizeof(struct test_struct));
if(NULL == ptr)
{
printf(\"\ Node creation failed \ \");
return NULL;
}
ptr->val = val;
ptr->next = NULL;
head = curr = ptr;
return ptr;
}
struct test_struct* add_to_list(int val, bool add_to_end)
{
if(NULL == head)
{
retur.
Similar to Complete the implementation of the binary search tree started in cla.pdf (20)
Briefly explain four functions of stems. SolutionFunction of S.pdfsanuoptical
Briefly explain four functions of stems.
Solution
Function of Stems:
1. It helps store water , as in cacti, and the products of photosynthesis, as in the trunk of sago
palm (Metroxylon sagu) and sweet palm (Argenga pinnata) which store large stock of starch
2. Young green stem also performs a minor role in the production of food through the process of
photosynthesis, but in some species (e.g. cactus) the stem is the chief photosynthesizing organ
3. It supports the leaves, flowers and fruits and connect them with roots. In trees and shrubs the
main stem or trunk provides a strong columnar structure from which branches are attached
raising the leaves upward to be expressed more fully to the sun
4. The plant stem serves as a means of asexual reproduction in many species..
AVR was one of the first microcontroller families to use A. on-chip .pdfsanuoptical
AVR was one of the first microcontroller families to use A. on-chip flash memory for program
storage B. one-time programmable ROM, EPROM, or EEPROM C. both A and B
EMBEDDED SYSTEMS is a computer system with a dedicated function within a larger A.
digital and logical system B. mechanical or electrical system C. both A and B An integrated
circuit that contains all the functions of a central processing unit of a computer is A.
Microprocessor B. Microcontroller C. Both A and b A main system bus, ram, rom/flash, and
typically a set of other devices such as a programmable interrupt controller, analog/digital
converters, any number of general purpose 10 devices A. Microcontroller B. Microprocessor
C. None of the above ASSEMBLY LANGUAGE is an assembly (or assembler) language, often
abbreviated asm, is a A. low-level programming language for a computer B. high-level
programming language for a computer A. C. both A and B
Solution
AVR was one of the first micro controller families to use on chipflash memory for program
storage
Embedded syatems are mechanical or electrical syatems
An integrated circuit that has all functions of a cpu is micro processor
Assembler language is low level programming language for a computer
A main system........... Micro processor.
A researcher was interested in studying Americans email habits. She .pdfsanuoptical
A researcher was interested in studying Americans email habits. She suspected that Americans
spend less than 7 hours a week answering their email.The General Social Survey in 2004
included a question that asked about the number of hours that the respondent spend on email per
week. The General Social Survey in 2002 asked 1,264 respondents this question. The sample
mean number of hours was 6.02 and the sample standard deviation was 7.80. Find the test
statistic.A. 4.47
Solution
Test Statistic
Population Mean(U)=7
Sample X(Mean)=6.02
Standard Deviation(S.D)=7.8
Number (n)=1264
we use Test Statistic (t) = x-U/(s.d/Sqrt(n))
to =6.02-7/(7.8/Sqrt(1263))
to =-4.47
ANS:B.-4.47.
A 50 mL stock sample of cells is diluted 110 six times. If 0.1 mL o.pdfsanuoptical
A 50 mL stock sample of cells is diluted 1/10 six times. If 0.1 mL of the most dilute sample
generates 75 colonies on an agar plate, calculate the original concentration of bacteria present in
the original sample?
Solution
Answer:
Given:
Dilution factor= 1/10^6
Number of colonies= 75
Volume of sample = 0.1 mL to the plate
CFU/ml = ?
cfu/ml = (no. of colonies)/ dilution factor x volume of culture plate
cfu/ml = (75)/ (1/10^6 x 0.1)
cfu/ml = 75 x 10^7.
Why are clocks (or timers) discussed in the context of IO systems.pdfsanuoptical
Why are clocks (or timers) discussed in the context of I/O systems?
Solution
1) Time operations are not standard across all systems.
2) A timer can be used to trigger operations and to measure elapsed time. It can be set to trigger
an interrupt at a specific future time, or to trigger interrupts periodically on a regular basis to take
place.
3) Provide current time, elapsed time, etc..
why the SSB receiver re-injects the missing carrier Why add the c.pdfsanuoptical
why the SSB receiver re-injects the missing carrier? Why add the carrier back in after
downshifting the incoming modulated signal instead of before
why the SSB receiver re-injects the missing carrier? Why add the carrier back in after
downshifting the incoming modulated signal instead of before
Solution
Re-injection of carrier is done by BFO,this re-injection of carrier allows easy de-modulation of
RF and even IF signal also.if injected carrier is at the wrong frequencyrelative to the station then
the audiio will become disorted..
80 µl of 10^-5 dilution of E. coli culture was plated on LB agar and.pdfsanuoptical
80 µl of 10^-5 dilution of E. coli culture was plated on LB agar and incubated at 37 degree
Celsius overnight. Next day, you observed 212 colonies on this plate. Based on this information,
calculate the viable count (cfu/mL) of the original E. coli culture.
Solution
Colony forming units (CFU)/mL (from plate C) = (no. of colonies x dilution factor) / volume of
culture plate
Number of colonies observed is = 212
Dilution factor is = 10^5
Volume of culture plate =80 µl
Colony forming units (CFU)/mL (from plate C) = 212*10^5/ 0.08 ml
= 26.50* 10^7 CFU/ml.
Which of the following statements about pyruvate is most accurate P.pdfsanuoptical
Which of the following statements about pyruvate is most accurate? Pyruvate can be produced
only from carbohydrates; Pyruvate dehydrogenase complex does not belong to the Krebs cycle.
Therefore, pyruvate dehydrogenase is not a step-controlling enzyme for the Krebs cycle;
Pyruvate can be reversibly converted to phosphoenolpyruvate by pyruvate kinase; Pyruvate is a
main precursor of oxaloacetate in the Krebs cycle; Pyruvate dehydrogenase converts pyruvate to
acetyl CoA and generates one NADH that is equivalent to 2ATP if the NADH is transferred to
mitochondria via glycerol 3-phosphate shuttle system.
Solution
Correct answer is B
Pyruvate dehydrogenase complex does not belong to Krebs Cycle.Therefore pyruvate
dehydrogenase is not a step controlling enzyme for krebs cycle.
PDH complex catalyses the conversion of Pyruvate into Acetyl CoA. Acetyl CoA then enters
Krebs cycle and forms oxaloacetate. Therefore action of PDH comples does not determine the
control of krebs cycle,..
Which CLI modes let you use the show running-config commandA. Use.pdfsanuoptical
Which CLI modes let you use the show running-config command?
A. User
B. Privileged
C. Global Configuration
D. Setup
E. All of the above
Solution
B is correct. You can run the show running-config command in Privileged (Enable) modes.
A, C, D, and E are incorrect. A, C, and D are incorrect because the show running-
configcommand is not available in these modes. E is incorrect because choices A, C, and D are
incorrect..
What is meant by star activity with respect to a restriction enz.pdfsanuoptical
What is meant by \"star activity\" with respect to a restriction enzyme.
I just need a 1-2 sentence explanation
Solution
1. Star activity is a general property of Restriction endonuclease.
2. During some non-standard reaction conitions, specific restriction enzymes are can cleave the
sequences which are similar , but not identical ,to their efined recognition seqences.
3.Such kind of soecificity has been calle \" Star activity\"..
Type III hypersensitivities are also referred to as immune complex me.pdfsanuoptical
Type III hypersensitivities are also referred to as immune complex mediated hypersensitivities.
Which cell is responsible for clearing the antibody-antigen complexes that are formed? In type I
hypersensitivity, prior sensitization to the antigen/allergen is not required because it\'s an
immediate type of reaction. True False Which cell types participate in antibody mediated
attacks of either cells or red blood cells in type II hypersensitivities?
Solution
Hypersensitive is the group of unfavourable reactions produced by the normal Immune system. It
includes allergies and Autoimmunity. Type-III immunity is immune complex mediated diseases
that include Serum sickness, Rheumatoid arthritis etc. The mediators are IgG, complement and
Neutrophills.
7. Answer is Macrophages.
8. False: Prior sensitization with allergin, leads to IgE production, then they bind to mast cells.
Again encounter wits same allergin, bind to these mast cell bound IgE. Finally leads to
degranulation and Type-1 hypersensitivity.
9. All three types of cells: Macrophages, NK cells and Neutrophils.
True, False, Uncertain with Explanation(a) Including an interacti.pdfsanuoptical
True, False, Uncertain with Explanation:
(a) Including an interaction term between two independent variables, X1 and X2, allows for the
measurement of the effect of a unit increase in X1 and X2, above and beyond the sum of the
individual effects of a unit increase in the two variables alone.
Solution
When an interaction is present, the lines in a graph of the means will not be parallel. Another
way of describing the interaction is to say that the effects of one factor are not the same at all
levels of the other factor.Also we woll say that “the simple effects are different,” because a
simple effect looks at the effects of one factor at each level of the other factor.
An interaction effect is a change in the simple main effect of one variable over levels of the
second. An A X B or A BY B interaction is a change in the simple main effect of B over levels
of A or the change in the simple main effect of A over levels of B.In either case the cell means
cannot be modeled simply by knowing the size of the main effects. An additional set of
parameters must be used to explain the differences between the cell means. These parameters are
collectively called an interaction.
If interaction is significant, determine whether interactions are important. If not, can examine
main effects
If interaction present & important, determine whether interaction is simple or complex.
. For simple interactions, can still talk about the main effects of A at each level of B
For complex interaction, must simply consider all pairs of levels as separate treatments.
If interaction effects are very small compared to main effects or only apparent in a small number
of treatments, then they are probably unimportant.
We can proceed by keeping interaction in the model, but using marginal means for each
significant main effect individually
The interaction effect is so large and/or pervasive that main effects cannot be interpreted on their
own.
This is TRUE statement..
Traits that are detrimental to the long-term survival of an individu.pdfsanuoptical
Traits that are detrimental to the long-term survival of an individual can occur in a population
(select all that apply):
a. if they arise due to a mutation.
b. Never
c. when the trait increases an individual\'s chance of reproducing.
d. because there has to be variation in the population.
e. if they enter the population through gene flow from another habitat where the traits are
favorable.
Solution
a. if they arise due to a mutation.
d. because there has to be variation in the population..
The sampling distribution of the sample mean is the probability dist.pdfsanuoptical
The sampling distribution of the sample mean is the probability distribution of all
a. the sample statistics and their probability of occurrence..
b. the normal population parameters and their probability of occurrence..
c. the possible sample means and their probability of occurrence.
d. sample means.
Solution
sample means..
The lantana has which inflorescence morphology type campanulte tub.pdfsanuoptical
The lantana has which inflorescence morphology type? campanulte tubular cruciform rotate
ligulate The rose has which inflorescence morphology type? campanulte tubular cruciform
rotate ligulate The fig is which type of fruit? Simple - Legume Simple - Drupe Simple - Berry
Multiple Aggregate
Solution
19- lantana has campanulate inflorescence
20-Rotate
21-Multiple fruit or false fruit.
The intensity of the sound of traffic at a busy intersection was mea.pdfsanuoptical
The intensity of the sound of traffic at a busy intersection was measured at 2.0 × 101 W/m2. Find
the decibel level. (Round your answer to the nearest whole number.)
Solution
Sound intensity of traffic at a busy intersection is given by I = 2×10^1 W/m².
Now,
Reference sound intensity Io = 10^12 W/m² (Threshold of hearing)
Reference sound intensity level LIo = 0 dB (Threshold of hearing level)
we need to find sound intensity level LI in dB when entering sound intensity I = 2×10^1 W/m².
Sound intensity level LI = 10×log (I / Io) dB = 10×log (2×10^1 / 10^12)=10*11.30 dB
= 113.01 dB
=113dB on round off.
The garden pea is described as self-fertilizing. What does this .pdfsanuoptical
The garden pea is described as \"self-fertilizing.\" What does this mean and why was this
significant to the success of Mendel\'s inheritance experiments?
Solution
The pea plant which Mendel chose for conducting experiments, is most ideal for controlled
breeding, since it can easily be subjected to cross pollination as well as self pollination. This
gives the success to Mendel\'s inheritance experiments.
The main other resons for mendal success are.
The equation for the time of one swing of a pendulum is given by T = .pdfsanuoptical
The equation for the time of one swing of a pendulum is given by T = 2 pi Squareroot L/32
where T is the time in seconds, pi almostequalto 3.14, & L is the length in feet. What is the
length of the pendulum if it makes one (1) swing in 4 seconds, according to the formula?
Solution
T=2*pi*(L/32)^.5
Squaring on both sides
(T/(2*pi))^2=L/32
Given time =4 sec
L/32= (4/(2pi))^2
L/32= 4/10
L=128/10
L=12.8
Length of pendulum =12.8 units
L/32=.
The assumption that arrivals follow a Poisson probability distributi.pdfsanuoptical
The assumption that arrivals follow a Poisson probability distribution is equivalent to the
assumption that the time between arrivals has
a normal probability distribution
an exponential probability distribution
a uniform probability distribution
a Poisson probability distributiona.
a normal probability distributionb.
an exponential probability distributionc.
a uniform probability distributiond.
a Poisson probability distribution
Solution
The assumption that arrivals follow a Poisson probability distribution is equivalent to the
assumption that the time between arrivals has b. an exponential probability distribution.
Some yeasts process xylitol and some cannot. The ability to process .pdfsanuoptical
Some yeasts process xylitol and some cannot. The ability to process xylitol is dominant… so
what would you cross a xylitol processing yeast with in other to determine if it is heterozygous
or homozygous dominant?
Solution
A xylitol processing yeast will be crossed with another xylitol processing yeast. If they are
homozygous dominant all offspring will be xylitol processing but if they are heterozygous
dominant then 25% of the offspring will not process xylitol..
Palestine last event orientationfvgnh .pptxRaedMohamed3
An EFL lesson about the current events in Palestine. It is intended to be for intermediate students who wish to increase their listening skills through a short lesson in power point.
The Indian economy is classified into different sectors to simplify the analysis and understanding of economic activities. For Class 10, it's essential to grasp the sectors of the Indian economy, understand their characteristics, and recognize their importance. This guide will provide detailed notes on the Sectors of the Indian Economy Class 10, using specific long-tail keywords to enhance comprehension.
For more information, visit-www.vavaclasses.com
Unit 8 - Information and Communication Technology (Paper I).pdfThiyagu K
This slides describes the basic concepts of ICT, basics of Email, Emerging Technology and Digital Initiatives in Education. This presentations aligns with the UGC Paper I syllabus.
The French Revolution, which began in 1789, was a period of radical social and political upheaval in France. It marked the decline of absolute monarchies, the rise of secular and democratic republics, and the eventual rise of Napoleon Bonaparte. This revolutionary period is crucial in understanding the transition from feudalism to modernity in Europe.
For more information, visit-www.vavaclasses.com
Instructions for Submissions thorugh G- Classroom.pptxJheel Barad
This presentation provides a briefing on how to upload submissions and documents in Google Classroom. It was prepared as part of an orientation for new Sainik School in-service teacher trainees. As a training officer, my goal is to ensure that you are comfortable and proficient with this essential tool for managing assignments and fostering student engagement.
Welcome to TechSoup New Member Orientation and Q&A (May 2024).pdfTechSoup
In this webinar you will learn how your organization can access TechSoup's wide variety of product discount and donation programs. From hardware to software, we'll give you a tour of the tools available to help your nonprofit with productivity, collaboration, financial management, donor tracking, security, and more.
Model Attribute Check Company Auto PropertyCeline George
In Odoo, the multi-company feature allows you to manage multiple companies within a single Odoo database instance. Each company can have its own configurations while still sharing common resources such as products, customers, and suppliers.
How to Make a Field invisible in Odoo 17Celine George
It is possible to hide or invisible some fields in odoo. Commonly using “invisible” attribute in the field definition to invisible the fields. This slide will show how to make a field invisible in odoo 17.
The Roman Empire A Historical Colossus.pdfkaushalkr1407
The Roman Empire, a vast and enduring power, stands as one of history's most remarkable civilizations, leaving an indelible imprint on the world. It emerged from the Roman Republic, transitioning into an imperial powerhouse under the leadership of Augustus Caesar in 27 BCE. This transformation marked the beginning of an era defined by unprecedented territorial expansion, architectural marvels, and profound cultural influence.
The empire's roots lie in the city of Rome, founded, according to legend, by Romulus in 753 BCE. Over centuries, Rome evolved from a small settlement to a formidable republic, characterized by a complex political system with elected officials and checks on power. However, internal strife, class conflicts, and military ambitions paved the way for the end of the Republic. Julius Caesar’s dictatorship and subsequent assassination in 44 BCE created a power vacuum, leading to a civil war. Octavian, later Augustus, emerged victorious, heralding the Roman Empire’s birth.
Under Augustus, the empire experienced the Pax Romana, a 200-year period of relative peace and stability. Augustus reformed the military, established efficient administrative systems, and initiated grand construction projects. The empire's borders expanded, encompassing territories from Britain to Egypt and from Spain to the Euphrates. Roman legions, renowned for their discipline and engineering prowess, secured and maintained these vast territories, building roads, fortifications, and cities that facilitated control and integration.
The Roman Empire’s society was hierarchical, with a rigid class system. At the top were the patricians, wealthy elites who held significant political power. Below them were the plebeians, free citizens with limited political influence, and the vast numbers of slaves who formed the backbone of the economy. The family unit was central, governed by the paterfamilias, the male head who held absolute authority.
Culturally, the Romans were eclectic, absorbing and adapting elements from the civilizations they encountered, particularly the Greeks. Roman art, literature, and philosophy reflected this synthesis, creating a rich cultural tapestry. Latin, the Roman language, became the lingua franca of the Western world, influencing numerous modern languages.
Roman architecture and engineering achievements were monumental. They perfected the arch, vault, and dome, constructing enduring structures like the Colosseum, Pantheon, and aqueducts. These engineering marvels not only showcased Roman ingenuity but also served practical purposes, from public entertainment to water supply.
This is a presentation by Dada Robert in a Your Skill Boost masterclass organised by the Excellence Foundation for South Sudan (EFSS) on Saturday, the 25th and Sunday, the 26th of May 2024.
He discussed the concept of quality improvement, emphasizing its applicability to various aspects of life, including personal, project, and program improvements. He defined quality as doing the right thing at the right time in the right way to achieve the best possible results and discussed the concept of the "gap" between what we know and what we do, and how this gap represents the areas we need to improve. He explained the scientific approach to quality improvement, which involves systematic performance analysis, testing and learning, and implementing change ideas. He also highlighted the importance of client focus and a team approach to quality improvement.
Complete the implementation of the binary search tree started in cla.pdf
1. Complete the implementation of the binary search tree started in class. You know you are done
when the main function runs correctly with all commented lines uncommented, and printing
shows the expected behavior of a BST.
CODE:
# TODO: implement inorder
# TODO: implement find
# TODO: implement maximum, minimum
# TODO: implement successor, predecessor
# TODO: implement delete
def main():
bst = Node(3, None)
for k in [5, 7, 4, 5, 6]:
bst.insert(k)
# print(bst.inorder())
# for k in [4, 3, 6, 2, 1, 7]:
# print("find {}: {}".format(k, bst.find(k) != None))
# for k in [4,3, 2]:
# n = bst.find(k)
# if n != None:
# s = n.successor()
# print("successor of {}: {}".format(k, s.key if s != None else None))
# s = n.predecessor()
# print("predecessor of {}: {}".format(k, s.key if s != None else None))
# s = n.delete()
# print("deleted {}".format(s.key))
# print(bst.inorder())
class Node:
def __init__(self, key, parent):
self.key = key # self is Python for "this"
self.parent = parent
self.left = None
self.right = None
def inorder(self):
2. '''returns list of the keys in an inorder traversal of the tree rooted at self'''
# TODO: replace "pass" keyword with actual code
# Hint: li.append(value) appends a value to list li
# Hint: li = list1 + list2 returns the concatnenation of list1 and list2
# Hint: use dot notation to call method: inorder(node) ---> node.inorder()
# To test: uncomment line 10 and click "Run"
li = [] # empty list
if self.left is not None:
pass
pass
if self.right is not None:
pass
return li
def insert(self, key):
'''inserts a new node with given key into subtree rooted at self node'''
if key < self.key:
if self.left is None: # None is Python for null, "is" = "==", "is not" = "!="
self.left = Node(key, self)
else:
self.left.insert(key)
else:
if self.right is None:
self.right = Node(key, self)
else:
self.right.insert(key)
def find(self, key):
'''returns a node in the subtree rooted at self with this key or
None if no such key exists'''
# Hint: similar to insert()
# Test: uncomment lines 11 and 12, click "Run"
pass
def minimum(self):
'''returns the node with minimum key in the subtree rooted at self'''
3. pass
def maximum(self):
'''returns the node with maximum key in the is subtree rooted at self'''
pass
def successor(self):
'''returns successor of the self node or None if it does not have one'''
# TODO: fill the if statement
if self.right is not None:
pass
c, p = self, self.parent
while p is not None and c is p.right:
c, p = p, p.parent
return p
def predecessor(self):
'''returns the predecessor of the self node or None if it does not have one'''
pass
def delete(self):
'''deletes the self node from the tree and returns that node'''
parent, left, right = self.parent, self.left, self.right
# case 0: no children
if left is None and right is None:
if parent is not None:
if self is parent.left:
parent.left = None
else:
parent.right = None
return self
# case 1: one or two children, no parent
elif parent is None:
s = self.predecessor() or self.successor() # whichever is not None
self.key, s.key = s.key, self.key
return s.delete()
4. # case 2: one child, one parent
# Hint: similar to case 0
elif left == None or right == None:
pass
# case 3: 2 children, one parent
# Hint: similar to case 1
else:
pass
main()
Solution
# TODO: implement inorder
# TODO: implement find
# TODO: implement maximum, minimum
# TODO: implement successor, predecessor
# TODO: implement delete
def main():
bst = Node(3, None)
for k in [5, 7, 4, 5, 6]:
bst.insert(k)
print( bst.inorder())
# print(bst.inorder())
for k in [4, 3, 6, 2, 1, 7]:
print("find {0}: {1}".format(k, bst.find(k) != None))
for k in [4,3, 2]:
n = bst.find(k)
if n != None:
s = n.successor()
print("successor of {}: {}".format(k, s.key if s != None else None))
s = n.predecessor()
print("predecessor of {}: {}".format(k, s.key if s != None else None))
s = n.delete()
print("deleted {}".format(s.key))
print(bst.inorder())
5. list1=[]
list2=[]
li = []
class Node:
def __init__(self, key, parent):
self.key = key # self is Python for "this"
self.parent = parent
self.left = None
self.right = None
def inorder(self):
#Node.inorder1(self.parent)
'''returns list of the keys in an inorder traversal of the tree rooted at self'''
# TODO: replace "pass" keyword with actual code
# Hint: li.append(value) appends a value to list li
# Hint: li = list1 + list2 returns the concatnenation of list1 and list2
# Hint: use dot notation to call method: inorder(node) ---> node.inorder()
# To test: uncomment line 10 and click "Run"
# empty list
if self.left is not None:
list1.append(self.left.key)
self.left.inorder()
if self.right is not None:
list2.append(self.right.key)
self.right.inorder()
li = list1+list2
return li
def insert(self,key):
'''inserts a new node with given key into subtree rooted at self node'''
if key < self.key:
if self.left is None: # None is Python for null, "is" = "==", "is not" = "!="
self.left = Node(key, self)
else:
self.left.insert(key)
6. else:
if self.right is None:
self.right = Node(key, self)
else:
self.right.insert(key)
def find(self, key):
#returns a node in the subtree rooted at self with this key or
# None if no such key exists'''
# Hint: similar to insert()
# Test: uncomment lines 11 and 12, click "Run"
if key < self.key:
if self.left is None: # None is Python for null, "is" = "==", "is not" = "!="
return True
else:
return True
elif self.right is None:
return True
else:
return False
def minimum(self):
'''returns the node with minimum key in the subtree rooted at self'''
current = self
# loop down to find the lefmost leaf
while(current.left is not None):
current = current.left
return current.data
def maximum(self):
'''returns the node with maximum key in the is subtree rooted at self'''
current = self
# loop down to find the rightmost right
while(current.right is not None):
current = current.right
return current.data
def successor(self):
7. '''returns successor of the self node or None if it does not have one'''
# TODO: fill the if statement
if self.right is not None:
return self.right.minimum()
c, p = self, self.parent
while p is not None and c is p.right:
c, p = p, p.parent
return p
def predecessor(self):
'''returns the predecessor of the self node or None if it does not have one'''
pass
def delete(self):
'''deletes the self node from the tree and returns that node'''
parent, left, right = self.parent, self.left, self.right
# case 0: no children
if left is None and right is None:
if parent is not None:
if self is parent.left:
parent.left = None
else:
parent.right = None
return self
# case 1: one or two children, no parent
elif parent is None:
s = self.predecessor() or self.successor() # whichever is not None
self.key, s.key = s.key, self.key
return s.delete()
# case 2: one child, one parent
# Hint: similar to case 0
elif left == None or right == None:
pass
# case 3: 2 children, one parent
# Hint: similar to case 1
else: