Answer:
It can be static, but it shouldn't, given the way it is invoked.
It can also be protected but <u>not</u> private.
Explanation:
The question is confusing, since the ComputeMpg() should be a public non-static member. Also, is this Java or C#?
Answer:
You can simplify the problem down by recognizing that you just need to keep track of the integers you've seen in array that your given. You also need to account for edge cases for when the array is empty or the value you get would be greater than your max allowed value. Finally, you need to ensure O(n) complexity, you can't keep looping for every value you come across. This is where the boolean array comes in handy. See below -
public static int solution(int[] A)
{
int min = 1;
int max = 100000;
boolean[] vals = new boolean[max+1];
if(A.length == 0)
return min;
//mark the vals array with the integers we have seen in the A[]
for(int i = 0; i < A.length; i++)
{
if(A[i] < max + 1)
vals[A[i]] = true;
}
//start at our min val and loop until we come across a value we have not seen in A[]
for (int i = 1; i < max; i++)
{
if(vals[i] && min == i)
min++;
else if(!vals[i])
break;
}
if(min > max)
return max;
return min;
}
Answer:
Explanation:
In information technology, architecture plays a major role in the aspects of business modernization, IT transformation, software development, as well as other major initiatives within the enterprise. IT architecture is used to implement an efficient, flexible, and high quality technology solution for a business problem, and is classified into three different categories: enterprise architecture, solution architecture and system architecture. Each of these classifications varies in their implementation and design, depending on the contextual business scope, organization structure, and corporate culture.
Architecture Level
Architecture level represents the scope boundary and granularity of details the architectural activity should take, based on organization hierarchy and communication audience.
- Enterprise Architecture (Company level) aligns technological strategies and execution plans with business visions and objectives by providing architectural oversight and guidance. Enterprise architecture also drives consolidation, reuse, and economy of scale by addressing company-wide goals in a holistic way across all IT projects.
-
Solution Architecture (Department level) models a solution vision that defines the IT systems, business processes and reusable services for a specific business unit, spanning across business and technology architectures.
-
System Architecture (Team level) defines the structure of an information system in terms of various subsystem components and their relationships with internal and external systems. System architecture focuses on application, data, and technology, and is called software architecture in some organizations.
Before making decision regarding system architecture the designer must consider the following points:
- Corporate organization and culture: System architecture must study day-to-day functions of business and users in order to understand corporate organization and culture. This will help in focusing on operational feasibility which will help in deciding other checklist items.
- Enterprise resource planning (ERP): Most of the organization use ERP software these days and it is important for the analyst to understand the compatibility of the ERP which is used to the proposed system.
- Total cost of ownership (TCO): System analyst must try to get solutions of different questions which helps in finding initial cost and cost which may add up during the development, which is total cost of ownership. This is most important at this will determine total cost and budget of system.
- Scalability: Determining system ability to expand or downsize according to business requirements.
- Security: What security system and policy needs to be implemented.
The equivalent of film speed in a digital camera is going to be sensitivity. This will make the correct answer B.