Answer:
<u>storage as a service</u>
Explanation:
Pinterest a platform <em>founded in December 2009 </em><em>by </em>Ben Silbermann, Paul Sciarra, and Evan Sharp.
Pinterest have become Amazon for storage as a service considering the fact that files more than 14 terabytes of new data are each day stored on the platform.
<em>These files includes images—known as pins, videos) and many more.</em>
Answer:
See explaination
Explanation:
class OurLinkedList<E> { // The head is the first node of the LinkedList private Node<E> head; /** * No argument constructor, as mentioned in question to initialize the head pointer with null */ public OurLinkedList() { head=null; } public void addFront(E e) { if(head==null) { head=new Node<E>(e);//forgot <E> } else { Node<E> temp=head; Node<E> n=new Node<E>(e); //forgot <E> n.setNext(temp); head=n; } } /* * The add(E data) method add the node to the end of the linked List, It first checks if the Linked List is empty or not >> If the * Linked list is not empty then, * the temp pointer traverses to the end of the linked List and inserts a new Node with data that is * passes as argument at the end of the linked List * */ public void add(E data) { if(head == null) { return; } Node<E> temp = head; Node<E> nodeToAdd = new Node<>(data); /* Moving temp pointer to end of the linked list where next pointer is null */ while(temp.getNext() != null) { temp.setNext(temp.getNext()); } // adding nodeToadd to the end of the linked List temp.setNext(nodeToAdd); } /** * This method checks if the head of the Linked List is null it returns TRUE otherwise it return FALSE */ public boolean isEmpty() { if(head==null) { return true; } return false; } /** * the method remove, removes the first node of the list. If the list is empty is does nothing, if the List is not empty * then it removes the first element of the linked List. */ public void remove() { if (!isEmpty()) { Node<E> toRemoved = head; head = head.getNext(); toRemoved.setNext(null); } } /** * the size() method returns the size of the Linked List, * this method calculates the size of the linkedList by traversing through each node and incrementing the * length variable value */ public int size() { int length = 0; Node<E> current = head; while (current != null) { current = current.getNext(); length++; } return length; } public String toString() { if(isEmpty()) { return "head ==> null"; } Node<E> temp=head; String s="head ==> "; while(temp!=null) { s+=temp.getData()+" ==> "; temp=temp.getLink(); } s+=" null"; return s; } /* method to reverse the Linked List */ Node<E> reverse() { Node<E> prev = null; Node<E> current = head; Node<E> next = null; while (current != null) { next = current.getNext(); current.setNext(prev); prev = current; current = next; } head = prev; return head; } }
Node.java
/* this file contains the Implementation of Node class, * Node class contains if pointer of Node type which points to next Node * and a variable to hold the data */ public class Node<E> { private E data; private Node<E> next; public Node(E data) { this.data = data; next = null; } public void setNext(Node<E> next) { this.next=next; } public Node<E> getLink() { return next; } public E getData() { return data; } public void setData(E data) { this.data = data; } public Node<E> getNext() { return next; } }
Main.java <Contains the drive code for the program>
/* This class is the driver class of the program, this file contains the * code which checks the working of other components of the program * */ public class Main { public static void main(String[] args) { OurLinkedList<Integer> llist=new OurLinkedList<Integer>(); // checking if linked list id empty System.out.println("is empty: "+llist.isEmpty()); // after adding first element to list llist.addFront(10); System.out.println("is empty: "+llist.isEmpty()); // adding more elements to th elist llist.addFront(20); llist.addFront(30); llist.addFront(40); // printing the list using toString() method System.out.println("\n\nBefore Reversing the list:\n"+llist.toString()); // calling the reverse method llist.reverse(); System.out.println("\n\nAfter Reversing the list:\n"+llist.toString());
}
}
Answer:
D). Algorithm
Explanation:
The set of specific, sequential steps that describe exactly what a computer program must do to complete the work is called an algorithm.
From the question, it is clear the correct option is algorithm.
In simple terms, to solve a problem the set of rules to follow is called algorithm. Algorithm in computer programming describes the steps that explains not only the task that needs to be performed, but also how to do it.
In algorithm, the steps are needed to be in the right sequence.
Answer:
- def processTime(timeStr):
- timeData = timeStr.split(" ")
- timeComp = timeData[0].split(":")
- h = int(timeComp[0])
- m = int(timeComp[1])
-
- output = ""
-
- if(timeData[1] == "AM"):
- if(h < 10):
- output += "0" + str(h) + str(m) + " hours"
- elif(h == 12):
- output += "00" + str(m) + " hours"
- else:
- output += str(h) + str(m) + " hours"
- else:
- h = h + 12
- output += str(h) + str(m) + " hours"
-
- return output
-
- print(processTime("11:30 PM"))
Explanation:
The solution code is written in Python 3.
Firstly, create a function processTime that takes one input timeStr with format "HH:MM AM" or "HH:MM PM".
In the function, use split method and single space " " as separator to divide the input time string into "HH:MM" and "AM" list items (Line 2)
Use split again to divide first list item ("HH:MM") using the ":" as separator into two list items, "HH" and "MM" (Line 3). Set the HH and MM to variable h and m, respectively (Line 4-5)
Next create a output string variable (Line 7)
Create an if condition to check if the second item of timeData list is "AM". If so, check again if the h is smaller than 10, if so, produce the output string by preceding it with a zero and followed with h, m and " hours" (Line 9 - 11). If the h is 12, precede the output string with "00" and followed with h, m and " hours" (Line 12 - 13). Otherwise generate the output string by concatenating the h, m and string " hours" (Line 14 -15)
If the second item of timeData is "PM", add 12 to h and then generate the output string by concatenating the h, m and string " hours" (Line 17 -18)
Test the function (Line 22) and we shall get the sample output like 2330 hours
Answer:
The answer is "Option 2"
Explanation:
In the given question the answer is "array bounds checking", It Checks the limits by providing a way, that Specifies whether a value is inside those limits has been used. It is a variable, that falls into a given class or function called as an array index of array, that's why all option are wrong, that is explained as follows:
- In option 1, It uses provides security, that's why it is wrong.
- In option 3, It works on the bits, that's why it is not correct.
- In option 4, It uses two thing that is "array bound checks and sub-script of bond", that's why it is wrong.