PYTHON
Search for an element in a 2D sorted matrix using the binary
search technique. Your code should run in O(m + n) where m is the
number of rows and n is the number of columns
The python file should have a function named binarysearch
The function should take two arguments. The first argument of
the function will be the element to search for. Second argument of
the function will be the matrix as a List[List].
The function should return the row and column of the matrix if the
element is found. Use a tuple to return the row and column. Return
"Not Found" if the element is not found.
Sample values for input and output :
Sample Input:
Case 1: binarysearch(4, [[1, 2, 3],[4, 5, 6],[7, 8, 9]] )
Case 2: binarysearch(10,[[2, 3, 4],[5, 7, 9],[11, 12, 13],[20, 22,
24]]
Sample Output :
Case 1: (1 , 0)
Case 2: Not Found
In: Computer Science
Docker containers can be considered a new era of virtualization that has fundamentally changed the IT industry. For this discussion question, provide a brief response that describes a Docker container and how a container differs from a hypervisor. What potential do you see in Docker containers?
In: Computer Science
The decimal number 210 expressed in binary is ____.
11010011
11011011
11010010
11010111
____ is the most important layer 3 security protocol.
ARP
NAT
DNS
IPSec
In: Computer Science
In pumping lemma I know how to prove 0^n 1^n is not regular but what changes when I have 0^n 1^n 2^n (three variables). Do I need to check 6 variations
of 0,1 and 2 instead of only 3 in 0^n 1^n?
thanks.
In: Computer Science
Developing a set of classes demonstrating inheritance - in class work
In: Computer Science
Write and run SQL statements to complete the following tasks
You are required to answer
1. The SQL statements for each query, which should be copied and pasted into word.
2. tell all the sql command for each question?
tables: -
VENDOR TABLE
V_CODE |
V_NAME |
V_CONTACT |
V_ARAECODE |
V_PHONE |
V_STATE |
V_ORDER |
PRODUCT TABLE
P_CODE |
P_DESCRIPT |
P_INDATE |
P_QOH |
P_MIN |
P_MIN |
P_DISCOUNT |
V_CODE |
CUSTOMER TABLE:
CUS_CODE |
CUS_LNAME |
CUS_FNAME |
CUS_INITIAL |
CUS_AREACODE |
CUS_PHONE |
CUS_BALANCE |
INVOICE TABLE:
INV_NUM |
CUS_CODE |
INV_DATE |
INV_SUBTOTAL |
INV_TAX |
INV_TOTAL |
LINE TABLE:
INV_NUMBER |
LINE_NUMBER |
P_CODE |
LINE_UNITS |
LINE_PRICE |
LINE_TOTAL |
EMPLOYEE TABLE:
EMP_NUM |
EMP_TITLE |
EMP_LNAME |
EMP_FNAME |
EMP_INITIAL |
EMP_DOB |
EMP_HIRE_DATE |
EMP_AREACODE |
EMP_PHONE |
EMP_MGR |
In: Computer Science
Discuss in details the applications and challenges of Mobile Database in Public and Private Sector
In: Computer Science
P-3.40 Implement a class, SubstitutionCipher, with a constructor that takes a string with the 26 uppercase letters in an arbitrary order and uses that as the encoder for a cipher (that is, A is mapped to the first character of the parameter, B is mapped to the second, and so on.) You should derive the decoding map from the forward version.
P-3.41 Redesign the CaesarCipher class as a subclass of the SubstitutionCipher from the previous problem.
P-3.42 Design a RandomCipher class as a subclass of the SubstitutionCipher from Exercise P-3.40, so that each instance of the class relies on a random permutation of letters for its mapping.
In: Computer Science
Explain what OS hardening is and why it is important? In addition, explain what could happen if OS Hardening is not done properly.
In: Computer Science
What is meant by best evidence? What are some examples? What is hearsay? When arriving at a crime scene, is it better to shut down the computer immediately or insure it stays on? What are the tradeoffs?
In: Computer Science
●In this task, the quick sort algorithm selects the first element in the list as the pivot. Revise it by selecting the median among the first, middle, and last elements in the list.
● Write the algorithm for searching for entries using linear probing.
● Write the algorithm for removing entries using linear probing.
● Create a diagram similar to the one above that shows the hash table of size 11 after entries with the keys 34, 29, 53, 44, 120, 39, 45, and 40 are inserted, using separate chaining.
I am very confused, this task involves algorithms , hashing and sorting.
THANK YOU IN ADVANCE
In: Computer Science
R-Studio (R Programming Language)
4. Let the data x be given by
`x <- c(1, 8, 2, 6, 3, 8, 5, 5, 5, 5)`
Use R to compute the following functions. Note, we use X1 to denote
the first element of x (which is 1) etc.
1. `(X1 + X2 + . . .+ X10)/10` (use sum)
2. Find log10(Xi) for each i. (Use the log function which by
default is base e)
3. Find `(Xi - 4.4)/2.875` for each i. (Do it all at once)
4. Find the difference between the largest and smallest values of
x. (This is the range. You can use `max` and
`min` or guess a built in command.)
```{r}
#insert your code
```
In: Computer Science
Using inner join, list the details of the products whose line price is greater than 100. what command we will use in sql?
In: Computer Science
For the following Ackerman function defined for non-negative
integers, write a Java program that:
Contains a method called computeAckermann that takes two integer
values as parameters and calculates and returns the value of the
Ackerman function. The method should be defined inside a class
named Ackermann.
Test the implementation of Ackerman in (a) by calling it from main
function and printing the returned value. The main function should
be defined in a separate class named AckermannDemo.
In: Computer Science
Everything changes—it’s the only constant. When things change on a network, there are new variables that can result in a compromise of the confidentiality, integrity, and/or availability.
Why must change be managed? What do we mean by change?
What are some examples of something on the network that changes that must be managed?
What are some of the possible consequences of not managing change?
Why is it important during the management of change to separate duties?
In: Computer Science