Answer:
int sumAll(int n)//function definition.
{
if(n==1)//if condition.
return 1;
else//else condition.
{
return n+sumAll(n-1);//return the value and call the function in recursive manner.
}
}
Explanation:
- The above-defined function is a recursive type function that is written in the c language, which holds the if and else condition.
- When the user passes the largest value from 1, then the else condition will be executed which adds the largest value and pass the value after the decrement of the value as an argument.
- When the value will become 1, then the function if-block will be executed which returns the value and ends the calling function recursively.
Answer:
<u>How to implement a stack in C using an array?</u>
A stack is a linear data structure that follows the Last in, First out principle (i.e. the last added elements are removed first).
This abstract data type can be implemented in C in multiple ways. One such way is by using an array.
Pro of using an array:
No extra memory required to store the pointers.
Con of using an array:
The size of the stack is pre-set so it cannot increase or decrease.
Answer:
Check the explanation
Explanation:
A packet filter firewall is used as a check point between internal corporate network to the outside internet. It blocks all the inbound traffic from the outside hosts trying to initiate a direct TCP connection to the internal corporate webserver. The network design with firewall is shown in the attached image below:
The figures in the attached image below shows an internal corporate network is protected with a packet filter firewall to minimize the inbound traffic from the external network or an internet. Therefore, the packet filter is used as a check point between the network.
The packet filter blocks all attempts by the outside hosts in order to initiate a direct TCP connection to the internal webserver of the internal corporate network.
Going by the second part of the attached image below can can therefore conclude that:
• Rule 1 specifies that, deny any packet with the destination address 5.6.7.8 if the STN flag of TCP header is set.
• Rule 2 specifies that, allow the inbound email traffic from the external source.
• Rule 3 specifies, allows the Outbound TCP traffic from the internal corporate network.
• Rule 4 specifies, allows outbound Email traffic from the internal corporate network to the external network.
• Rule 5 specifies, block any traffic from any source to the any destination.
The same current flows through each part of a series circuit. The total resistance of a series circuit is equal to the sum of individual resistances. ... The voltage drop across a resistor in a series circuit is directly proportional to the size of the resistor. If the circuit is broken at any point, no current will flow.
Answer:
Explanation:
a)use order by clause for sorting
for $x in doc("books.xml")/bib/book order by xs:float($x/price) return $x/title (default sorted in ascending order)
or
for $x in doc("books.xml")/bib/book order by xs:float($b/price) descending return $b/title (sorted in descending order)
b)doc("books.xml")//book[author = 'Abiteboul']
c)for $x in distinct-values(doc("bib.xml")/bib/book/author)
return <res>
<name>{$x}</name>
<count>
{count (doc("bib.xml")//book[exists(indexof(author,$x))]) }
</count>
<res>