Академический Документы
Профессиональный Документы
Культура Документы
Computer Stream
Name: _____________________________Code_________________________
General Instructions
Good Luck!
Page 1
Part I (Explain)
1. Write down OSI model layers and their major function or tasks(3 pts)
Page 2
2. Write down TCP/IP model layers and their major function tasks.(3 pts)
Page 3
3. Define the following network protocols, terms and words. (4 pts)
SMTP
TCP
UDP
Https
Page 4
4. Write a pseudo code for insertion-sort algorithm? (4 pts)
Answer:
For j= 2 to A.Length
Key = A[j]
i= j-1
A[i+1] = A[i]
i= i-1
A[i+1] = key
Page 5
5. What is operating system and list its major functions? (3 pts)
Answer:
An operating system (OS) is system software that manages computer hardware and software
resources and provides common services for computer programs. All computer programs,
excluding firmware, require an operating system to function.
I. Process Management:
II. Memory Management:
III. Scheduling
Page 6
6. Briefly explain the difference between stack and queue? (3 pts)
Answer:
Queue is also an abstract data type or a linear data structure, in which the first element is inserted
from one end called REAR(also called tail), and the deletion of exisiting element takes place
from the other end called as FRONT(also called head). This makes queue as FIFO data
structure, which means that element inserted first will also be removed first.
The process to add an element into queue is called Enqueue and the process of removal of an
element from queue is called Dequeue
Stack is an abstract data type with a bounded (predefined) capacity. It is a simple data structure
that allows adding and removing elements in a particular order. Every time an element is added,
it goes on the top of the stack; the only element that can be removed is the element that was at
the top of the stack, just like a pile of objects.
Page 7
7. Clearly explain stored program concept with the help of neat block
diagram? (3 pts)
Answer:
Page 8
8. What is pipelining and explain its advantage? (3 pts)
Definition:
Advantage:
Page 9
9. Compare and contrast two popular computer architectures? (4 pts)
Answer:
Page 10
Part II (programming using Java/C++)
Answer:
return max2;
}
Page 11
2. Write a function that accepts a character array, a zero-based start
position and a length. It should return a character array containing
length characters starting with the start character of the input array
[sub array]. The function should do error checking on the start position
and the length and return null if the either value is not legal.(5 pts)
Answer:
static char[] a3(char[] a, int start, int length)
{
if (length < 0 || start < 0 || start+length-1>=a.length)
{
return null;
}
return sub;
}
Page 12
Part III (Design)
Page 13
2. A database is being constructed to keep track of the teams and games of
a sports league. A team has a number of players, not all of whom
participate in each game. It is desired to keep track of the players
participating in each game for each team, the positions they played in
that game, and the result of the game. Design a Relational Database
Schema diagram for this application, stating any assumptions you
make. Use football as sport league.(10 pts)
Page 14