# Fe exam book pdf

Date published

The Fundamentals of Engineering (FE) exam is computer-based, and the FE The PDF version of the FE Reference Handbook that you use on exam day will. The full exam specifications for each discipline are included in this book and are posted online at maroc-evasion.info WHAT CAN I TAKE INTO THE EXAM. Engineer-in-Training (EIT) Exam. Importance Engineering (FE) exam is while you are enrolled in college Closed book - reference material is supplied (can.

 Author: RAMONA BRANDORFF Language: English, Spanish, Indonesian Country: Australia Genre: Biography Pages: 717 Published (Last): 18.10.2015 ISBN: 392-4-53998-376-1 Distribution: Free* [*Registration needed] Uploaded by: DANYEL Preparation for Morning Exam Part2: Trial Exam Set. Chapter 1 Computer Science Fundamentals 2 1. Chapter 4 Network Technology 4. Chapter 6 Security and Standardization 6. The Morning Exam questions are formulated from the following seven fields: Here, detailed explanations of each field are provided in the beginning of each chapter, followed by the actual questions used in the past exams, as well as answers and comments that are included in the end of each chapter. Chapter Objectives In order to become an information technology engineer, it is necessary to understand the structures of information processed by computers and the meaning of information processing. All information is stored as binary numbers in computers; therefore, in Section 1, we will learn the form in which decimal numbers and characters we use in daily life are stored in computers. In Section 2, we will study logical operations as a specific example of information processing. In Section 3, we will learn data structures, of which modification is necessary to increase the ease of data processing. Lastly, in Section 4, we will study specific data processing methods.

Some of the formats that represent numerical values in a computer are shown below. Highly compatible with text data also known as Zoned decimal Decimal unpacked decimal number Packed decimal Faster computing speed. Fixed-point Used for integer data, indexes for arrays, etc. Binary number Used for real-number data, scientific computing, Floating-point etc. If the final result is to be represented in a radix other than 10 binary, octal, hexadecimal, etc.

Positive or zero 1 2 3 - 4 Zone bits8 Numeral bits Sign bits Numeral bits Zone bits: In the packed decimal format, each digit of the decimal number is represented with 4 bits, and the last four bits indicate the sign. The leading space of the highest byte is padded with 0s. The bit pattern of the sign bits is the same as that of the zoned decimal format.

In the examples shown below, 2 bytes and 4 bits are sufficient to represent the numbers, but in both cases 3 bytes are used by appending four leading 0s since computers reserve areas in byte9 units. A byte is a unit of 8 bits. It is the unit for representing characters.

Hence, 10 is represented as 2. The bit length varies from computer to computer. In general, the numbers from -2n-1 through 2n-1 — 1, a total of 2n numbers, can be represented by using n bits. Note that, considering only the absolute values, one more negative number can be represented in comparison with positive numbers. However, since the computer register11 has a limited number of digits, an error may occur in representing the value of repeating fraction.

The complement of a number is the value obtained by subtracting the given number from a certain fixed number, which is a power of the radix or a power of the radix minus 1. For instance, in decimal, there are ten's complements and nine's complements. In binary, there are two's complements and one's complements. In general, in the r-ary system, there are r's complements and r-1 's complements.

## FE prep books.pdf

If x is an n-digit number in the r-ary system, r's complement of x is rn-x , and r-1 's complement of x is rn-1 -x. Note that one's complement in binary is just the reverse of each bit 0 becomes 1 and vice-versa.

Two's complement is one's complement plus 1. It is low-capacity, high-speed memory placed in the CPU for temporary storage of data. A non-numerical representation refers to a representation of data other than numerical values. In other words, it refers to a representation of character, sound, or image. The way in which the data is internally represented differs from computer to computer. Hence, in order to ensure smooth data exchange between computers, it is necessary to establish some standardized representations.

Each digit of decimal number can be represented by using 4 bits. The following shows such an example. Chinese and Hangul characters are also handled. Hence, data compression technologies are crucial in constructing a multimedia system. Their representation technologies are also important. On the other hand, data for representing multimedia such as still images and sound are readily available on PCs since the technology for digitizing analog data has been advancing.

Computers are equipped with circuits to perform the four fundamental arithmetic operations and shift operations. For operations such as computing 2n, the operation speed improves by using shift operations or moving digits. All computer operations are executed in the register. This register14 has only the limited number of significant digits, so an operation result may contain a margin of error. It is the low-capacity, high-speed memory placed in the CPU for temporary storage of data; this includes general-purpose registers used by the CPU to carry out operations.

Shift methods can be classified as shown below. Arithmetic shift Logical shift Left shift Arithmetic left shift Logical left shift Right shift Arithmetic right shift Logical right shift.

An arithmetic shift is used when data is handled as numeric data with a positive or negative sign; it is an operation of shifting a bit string, except for the sign bit, representing a fixed-point number. In general, shifting left by n bits increases the number by 2n times.

The arithmetic right shift, on the other hand, inserts a value identical to the sign bit into the leftmost place that has been made empty by the shift. Examples of 1-bit arithmetic shifts are illustrated below. Shifting 1 bit to the left doubles the value while shifting 1 bit to the right reduces the value to half. Unlike an arithmetic shift, a logical shift does not handle the data as numeric data; rather, it handles the data merely as bit strings.

It shifts an entire bit string of data and inserts 0s in places vacated by the shift. In logical shifts15, there is no such relation as a change by 2n or 2-n times in arithmetic shifts. Examples of 1-bit logical shifts are illustrated below:. Overflow Overflow If the data is numeric, this means that a positive number changes to a negative number by the shift operation. Such a difference is called an error. Since computers cannot handle an infinite non-terminating fraction, bits smaller than a certain bit are rounded off, rounded down, or rounded up to the value with the limited number of significant digits.

The difference between the true value and the result of such rounding is called the rounding16 error or round-off error. When one number is subtracted from another number almost identical to it, or when two numbers, one positive and the other negative, with almost identical absolute values are added together, the number of significant digits could drop drastically.

This is called a cancellation of significant digits or cancellation error. Since the higher digits become 0, the number of significant digits decreases drastically. When a very large number and a very small number are added together, or when one is subtracted from the other, some information or a part thereof in the lower digits, which cannot be contained in the mantissa, can be lost due to the alignment of the numbers.

This is called a loss of trailing digits. In order to keep the error by loss of trailing digits small, it is necessary to do addition and subtraction in an order starting with numbers with small absolute values.

It is a way to approximate a number by rounding off, rounding down, or rounding up so that it can be easily handled by people. For instance, if 2. Quiz Q1 Express the decimal number in the binary, octal, and hexadecimal notations. Q2 Perform arithmetic right and logical right shifts by 3 bits on the 8-bit binary number A1 Binary: For conversion to octal: For conversion to hexadecimal: Arithmetic shift Logical shift A3 Cancellation of significant digits: Loss of trailing digits: To make a computer perform a task, a program written according to rules is needed.

Here, we will learn about logical operations, BNF, and reverse Polish notation. Logic operations are fundamental to the mechanism of operations. BNF is syntax rules for writing programs. Reverse Polish notation is used to interpret mathematical formulas written in programs. Logical negation is sometimes referred to simply as negation. All operations are executed using combinations of these circuits. Exclusive logical sum can be expanded, as shown below. Many questions can be easily answered if you know the expanded form of exclusive logical sum, so be sure to know the expanded formula.

These laws give the relations, as shown below. You can easily memorize them if you remember to exchange logical products and logical sums when removing parentheses. Many questions can be easily answered if you know De Morgan's theorem, so be sure to know these formulas.

Negation of logical product: There are also many questions that can be easily answered if you know the expanded form of exclusive logical sum. Here, C indicates a carry-over, and S is the lower bit of the result of addition.

The binary addition result is shown below. As seen here, C is the logical product, and S is the exclusive logical sum. In the figure below, the circuit structure of a half adder is shown on the left. The figure on the right is simplified notation for a half adder, which is generally used. As a shortcut, most of these questions can be answered if you know logical operations, but you can save time by knowing the operation results of adders.

Be very careful since it is easy to make careless mistakes. The four additions of 1-bit binary numbers are shown below. For a full adder, there are three input values, one of which is the carry-over from the lower bit. Hence, a full adder adds three values X, Y, and Z. The addition results are as shown below. Unlike half adders, there are no general relations such as logical product and exclusive logical sum with a full adder. In the figure below, the circuit structure of a full adder is shown on the left.

As shown in the figure, a full adder consists of two half adders combined. The figure on the right is simplified notation for the full adder.

To define the grammar of a programming language syntax definition , expressions free from any ambiguity are required. BNF defines the rules of character orders by using characters; it also defines repetition and selection using appropriate character symbols. Since only characters are used in the definitions, the expressions are simple and close to the final descriptive style of the sentences. Furthermore, not only does BNF give unambiguous definitions, it is also considered to be easy to understand.

BNF is a language to define syntax formally, not to stipulate any meanings. Hence, it cannot define every rule of a language, so today many extensions of BNF are used. These syntax elements are called non-terminal symbols. These angle brackets are used when characters are consecutively placed or when the bounds are unclear; these do not have to be used. These are used to make the syntax definition easy to understand.

For clarity, we include in our example the part surrounded by [ ], which can be omitted. The numeral is defined as follows:. These designated characters are called meta-characters. Meta-characters have specific meanings.

Therefore, we can have the following:. As you can see, if all specific forms are to be expressed, that would result in an enormous amount of information. BNF is thus used to give general definitions to avoid such a situation.

Reverse Polish Notation is a method of expressing mathematical formulas we use every day in a form more easily processed by computers. The basic concept of this notation is that the operators are written toward the end as opposed to the middle of a formula. The underlined part is to be calculated first It is best if you learn how to answer these questions intuitively. Here, the underlined parts indicate the parts that can be converted. The fundamental concept is the same as that of Reverse Polish Notation.

If there are not two variables, search for the next variable. Quiz Q1 Given the values of logical variables x and y below, complete the table below by calculating the logical product, logical sum, and exclusive logical sum. A2 Adder: Half adder: An adder that does not take into account carry-overs from lower bits. There are two input values and two output values.

Full adder: An adder that does take into account carry-overs from lower bits. There are three input values and two output values. When considering procedures algorithm for a program, it is easier to create an algorithm if you put data in certain typical patterns. Such typical patterns are called data structures. Some popular data structures are arrays, lists, stacks, queues, and trees.

An array is a data structure consisting of multiple data of the same type. For example, imagine children lined up in a single row. An array is used when multiple data of the same type are handled not individually but in relation to one another. The data is given an array name, and each data field element is identified by an index. Each array is given a name. An index number represents the position of an element in the array. In some languages, square brackets [ ] are used. However, any question on a data structure or an algorithm always uses an array.

Hence, you must understand arrays properly. More specifically, be sure that you understand how to use the index. Questions on algorithms on the exam may have indexes starting at 0 or 1, so care must be taken.

Column 1 Column 2 Column 3 Column 4 Row 1 a 1,1 a 1,2 a 1,3 a 1,4 Row 2 a 2,1 a 2,2 a 2,3 a 2,4 Row 3 a 3,1 a 3,2 a 3,3 a 3,4. In general, the elements of a 2-dimensional array are identified using two sets of index numbers m and n. When the elements of a 2-dimensional array are stored as a 1-dimensional array, there are two methods that can be used, depending on the order in which the elements are stored: Column-directional Row-directional a 1,1 storage a 1,1 a 1,2 a 1,3 a 1,4 storage a 1,1 a 2,1 a 2,1 a 2,2 a 2,3 a 2,4 a 1,2 a 3,1 a 3,1 a 3,2 a 3,3 a 3,4 a 1,3 a 1,2 a 1,4 a 2,2 a 2,1 a 3,2 a 2,2 a 1,3 a 2,3 a 2,3 a 2,4 a 3,3 a 3,1 a 1,4 a 3,2 a 2,4 a 3,3 a 3,4 a 3,4.

In the figure above, take notice of the difference in the indexes. In row-directional storage, y is changing first. When referring to an array, it is more efficient to look up the elements consecutively than to access skipping here and there. Hence, for efficient processing, the indexes are controlled as follows: With this arrangement, referring to a 2-dimensional array is made more efficient when it is converted to a 1-dimensional array.

A 2-dimensional array is used when storing objects like mathematical matrices. A list is a set of identical or similar data placed logically in one line linear37 ; its structure is similar to that of an array. The difference is that, whereas the elements of an array are placed physically right next to one another, the elements of a list can be placed at independent locations, and pointers establish connection between them.

Because of this, sometimes arrays and lists are distinguished from each other by another pair of terms: A pointer is information indicating the storage location address of the next element.

Each element is connected by a pointer, so the elements need not be placed in order. A list can have a variety of structures. The figure below is called a one-directional unidirectional list. Element Data Pointer part part. The pointer to the initial element is stored in the variable called the root.

The last element D of the list has no element following it, so its pointer includes the symbol X indicating that the element is the last one in the list. In some programming languages, this symbol may be stored automatically; in others, any symbol can be given. The important thing is to assign a value that cannot exist as data.

An array is linear since the elements are placed in consecutive area. On the other hand, a connected list is a structure where the elements are linked by pointers, so they may not be placed in consecutive locations.

A bidirectional list is one in which each element has a pointer indicating the previous element as well as a pointer indicating the next element. A ring list is one in which the last element has a pointer indicating the location of the first element. To insert an element into a given list, all we have to do is to change some pointers appropriately. First, in the pointer part of the element to be inserted to the list, enter the address of the element that is to immediately follow the element.

Next, change the pointer part of the element immediately preceding the element to be inserted so that the pointer part can have the address of the element that is to be inserted.

To delete an element from a given list, just as in insertion, all we have to do is to change pointers. Change the pointer part of the element immediately preceding the element to be deleted so that the pointer can indicate the data immediately following the element to be deleted. The data to be deleted remains as garbage until the list is re-structured, so it is necessary to perform, in a timely manner, garbage collection 40 to delete unnecessary elements.

You must carefully consider which element it is whose pointer should be stored. It is the procedure whereby small, fragmented unused memory and other areas not usable due to memory leak are combined together in order to increase usable memory space. If garbage is not collected, usable memory space continues to decrease and finally the system restart will be required. It means the situation wherein the main memory secured dynamically by an application is not released for some reason and remains in the main memory.

## FE Exam Preparation Book VOL1 LimitedDisclosureVer

To eliminate memory leak, garbage collection is necessary. A stack is a data structure in which data insertion and deletion both take place on the same end of the list. Conceptually, it can be described as shown below.

Top the highest level of the stack. Bottom the lowest level of the stack. The end where insertion storage and deletion removal of elements take place is called the top, and the other end is called the bottom. Insertion is called push-down while deletion is pop-up. The pointer called stack pointer SP is used to keep track of where the top of the stack currently is; we can store an element into or remove an element from the position indicated by SP.

The stack pointer sometimes points at the actual top element, and sometimes one place beyond it, depending on implementation. Further, if a subprogram calls other subprograms, the return addresses of the called programs are stored in the stack each time in sequence.

The pattern is that frequently there are questions asking what happens to the contents of a given stack when push and pop are repeated. Every time a subprogram is called sequentially, the return address is stored into the stack.

Since taking out follows the order opposite the order in which storing took place, the subprograms are returned in the opposite order as well.

A structure wherein a subprogram is called from within another subprogram like this is referred to as nested structure. In case of the following list, an element can be added to or deleted from the top of the list.

As a result, by combining insertion and deletion, we can implement the stack. A queue is a data structure in which insertion takes place at one end while deletion taking-out occurs at the other end. Conceptually, it is described as shown below. The first data in a queue is called the head while the last data is called the tail.

A queue is sometimes referred to as a waiting list; this name came from the concept of processing sequentially. In a queue, new data is always stored enqueued after the last data, and the first oldest data is always deleted dequeued first.

In online transaction45 processing, messages electronic texts are entered into a queue and processed in the order of entrance. Insertion is performed at the end of the list, and deletion is performed at the head. Suppose there is a list as shown below. For example, a line of people waiting to download train tickets from a ticket vending machine is a queue, as those who joined the line first download tickets first.

Because of this metaphor of people waiting in lines, sometimes a queue is called a waiting list. It is the processing mode in which a process request is immediately executed and the result is returned, such as seat-reservation systems of trains and airlines. For example, when ticketing is requested for a train ticket, the ticket is immediately printed. A request for processing is called a transaction.

A queue processes tasks in the order in which they arrived; a TSS splits the processing time among the tasks. So even if a program or a terminal does not finish its processing, after a certain amount of time has elapsed, another program or a terminal begins its processing.

A TSS is accomplished by multiprogramming. A tree is a data structure that expresses the hierarchical structure between elements. It is used for the organizational chart of a company, system configuration, etc. It has a root at the top, and nodes are joined by edges branches. A node directly above another node is called a parent, and a node directly below another is called a child. A node without any children is called a leaf.

A part of a tree is called a subtree. Given a node, the subtree to the left of it is called the left subtree; the one on the right is the right subtree. Edge Node Level 1 Child Parent. Child Parent Level 2. The right subtree of the node 2 Child Leaf Level 3. It is a method where multiple programs appear to be running at the same time.

No computers can actually execute multiple programs concurrently. Hence, the computer uses time-sharing to switch, at short time intervals, the program being executed so that it can appear as though multiple programs are being executed concurrently. Each parent thus has as many pointers as its children. If a binary tree is such that all leaves are at the same depth, or if the difference of depth between any two leaves is 1 or less and the leaves are laid out from the left, then such a tree is called a complete binary tree.

The values of all nodes are greater than the value 4 of the root. Keep straight in your mind the characteristics of various binary trees, such as complete binary trees, binary search trees, and heaps. This is a characteristic of a binary search tree. The heap which meets the former condition is called the max-heap, and the min-heap for the latter condition. As a result, elements with large or small values are close to the root whereas elements with small or large values are toward the leaves.

It is a data structure suitable for retrieving a maximum or minimum value since the root is the element with the largest or smallest value. Maximum value The value is large. The value is small. Hash is the concept of using key values directly as the storage locations of data.

For example, suppose there is an array H of size If the key values are two digits from 01 through 99 without duplication, these key values can be directly used as index numbers. This is called the direct search method.

## FE prep maroc-evasion.info | Engineer | Mechanical Engineering

However, it is rare that key values can be directly used as index numbers. Thus, to convert key values to index numbers, a hash function52 is used to calculate hash values, which are then used as index numbers. The array that stores elements using such a method is called a hash table. Consider now the hash function that divides a given key value by the number of elements in the array and adds 1 to the remainder. Take out the root, restructure the heap, and repeat this process; this way, you can take out the elements in the order of their values, from the largest to the smallest.

A function that calculates data addresses index numbers, etc. If there are n elements, then the remainder will be 0 through n — 1 , so adding 1 will give hash values of 1 through n. These can then be used as index numbers to be stored in the array.

However, the keys involve a variety of values, so the same index number can be produced from different key values by calculating the index number hash value 1 through n using the hash function.

When the same hash value is generated in this way, it is called a collision. The hash table contains in advance only the pointer indicating the first data of the list.

The figure below shows an example in which three pieces of data are stored in the position with index number 1 in the hash table. This hash table has a pointer indicating the first data.

The position of the next data is found by looking up the pointer part when the first data is read. When a hash function is used to calculate storage addresses, different key values could result in the same hash value. This is called a collision. Data that had been stored first when a collision occurred 56 Synonym: Data that came in later when a collision occurred. Re-hashing refers to re-calculating the storage location when a collision occurs and storing the new data there if the location is empty.

For example, elements a, b, and c are stored in their respective positions designated by the index numbers according to the hash values calculated. Next, element d has the hash value 1, but position 1 is already taken by element a stored in that location. But, that location is also taken, and the same goes for index number 3.

Then, looking up position 4, that location is empty. As a result, element d is stored in the position with index number 4. If there happens to be no vacancy all the way to the end of the hash table, the search goes back to the first position of the table and looks for the first vacancy in a similar way. Quiz Q1 What do we call a data structure whose concept is shown in the following figure? Q5 What do we call a binary tree with the following relation: A4 Binary tree: A tree in which each node has no more than 2 children Complete binary tree: A binary tree such that all the leaves are at the same depth or that the difference of depth between any two leaves is 1 or less and the leaves are laid out from the left.

A set of procedures to solve a problem is called an algorithm. A figure expressing the set of procedures to obtain appropriate results is called a flowchart. Here, we have selected basic algorithms to study.

Search means finding an element in a table 1-dimensional array , and there are two types of search methods: Linear search can be performed regardless of how the elements are sorted, but binary search requires that the elements be sorted in ascending or descending order. It can be done regardless of how the elements are sorted, but it takes longer than binary search.

If N is the number of elements, at least 1 if the element to be sought is located at the beginning of the table and at most N if the element to be sought is at the end of the table or does not exist comparisons are necessary. In linear search, comparisons are made from index number 1 and continued as 1 is added to the previous index number until the index number reaches N.

It is compared with the first value, the second, …, the fifth. These numbers indicating the positions of elements are the index numbers. Rules on the pseudo-language are not released, so it is a good idea to look through them in advance. After the first comparison, the right or left half of the table is discarded, and the middle value of the remaining part of the table is used for the next comparison.

Since the range to be searched is reduced to half each time, this type of search is faster on average than linear search. Let us explain a specific algorithm, using the following array as an example.

The range is the entire array. Let L be the lower bound and U be the upper bound of the range. Let M be the middle value median. The median can be obtained by rounding the quotient up or down; either is acceptable. Here, we round it down for our explanation.

Since the first comparison made it clear that the desired value is not in the left half of the table including the median, we change the search range. Here, the lower bound is changed to the value immediately to the right of the median. The value of L is then changed as follows: As a result, the search range changes as shown below.

In the same way as the first comparison, we find the new median as follows: Order in which data is sorted from the smallest key value to the largest key value 59 Descending order: Order in which data is sorted from the largest key value to the smallest key value 60 Hints and Tips When deleting the left half of a table, the new lower bound is the median plus 1; when deleting the right half, the new upper bound is the median minus 1.

Since the elements are sorted in ascending order and the desired value is smaller than the value of the median. Since the second comparison made it clear that the desired value is not in the right half of the search range including the median, we change the search range.

Here, the upper bound is changed to the value immediately to the left of the median. The value of U is then changed as follows: Since the third comparison made it clear that the desired value is not in the left half of the search range including the median, we change the lower bound in the same way as the second comparison. As a result, the search range is as shown below.

The new search. Linear search requires 7 comparisons to find the value. Consequently, even though binary search is more complex, the number of comparisons is reduced. Here, linear search is faster. To address this issue, there is a concept called the mean number of comparisons. When the number N of elements is very large, this value tells us how many comparisons are required on average. We omit detailed explanations here, but this is obtained by the following formulas: Let me add a word on the square brackets [ ] used in [log2N].

In general, log2N is not an integer, but the number of comparisons must be an integer. Hence, [ ] denotes deleting, or truncating, the fractional part. For example, [ Arranging elements from the smallest key value to the largest is called sorting in ascending order, and ordering them from the largest key value to the smallest is called sorting in descending order.

Other books: TET EXAM BOOK PDF

Sorting the contents of an area in a program, such as an array, is called internal sorting whereas sorting data stored in an external device such as records in a file is called external sorting file sorting. Be careful not to switch the index numbers when data is switched. In case of sorting in ascending order, the maximum value is put as the last element in the array. Next, going back to the beginning, the values are checked and exchanged when necessary. On the second run, the element at the end of the array is outside the sorting range.

Continuing this process, the range gets smaller each time, and the sorting ends when the first and second elements are compared. Below is an example of sorting in ascending order. Before sorting 5 4 3 2 1: Exchanging 5 and 4 4 5 3 2 1: Exchanging 5 and 3 4 3 5 2 1: Exchanging 5 and 2 4 3 2 5 1: Exchanging 5 and 1 4 3 2 1 5: First run finished the maximum value at the right end Second run 4 3 2 1 5: Exchanging 4 and 2 3 2 4 1 5: Exchanging 4 and 1 3 2 1 4 5: Second run finished second largest value at second from the right Third run 3 2 1 4 5: Exchanging 3 and 1 2 1 3 4 5: Third run finished third largest value at third from the right Fourth run 2 1 3 4 5: Fourth run finished sorting complete.

Next, it finds the maximum or minimum value from the array except for the last element and exchanges it with the second-to-the-last element of the array. Repeating this procedure, selection sort ends when it compares the first and second elements of the array.

Since 4 is the maximum value, it is exchanged to the last element in the second run. Bubble sort and selection sort have appeared very frequently, so be sure to understand their algorithms well.

The questions are given in a variety of ways, such as on the contents of an array at an intermediate stage and filling in blanks of a flowchart. Be sure that you understand the algorithms well. Here, since there is only one element on the first run, it is already considered to have been sorted. Since 4 is the least value, it is inserted in the appropriate location before 5. Second run 4 5 3 2 1: Since 3 is the least value, it is inserted in the appropriate location before 4.

Since 2 is the least value, it is inserted in the appropriate location before 3. Fourth run 2 3 4 5 1: Since 1 is the least value, it is inserted in the appropriate location before 2. Sorting complete. Then, the same procedure is repeated for each group. This is continued until there is only one element in each group. As a result, the array is sorted. The underlined values are the pivots.

Divided into two blocks Second run 2 1 3 5 6 4: Divide each block into two Third run 1 2 3 4 5 6: Divide each block into two except for those groups with only 1 element Fourth run 1 2 3 4 5 6: In merge sort, splitting is repeated until each group has only one element.

When each group has only one element, the elements are merged together in sequence. First, the elements are sorted roughly by using insertion sort with gaps of a certain size.

Then, insertion sort is used again to complete the sorting operation. Initially the gap is set to size 2, i. Then, the gap is made 1, and insertion sort is used. Unsorted 2 4 5 3 1: Every other element is sorted the underlined elements are sorted. First run complete Second run 1 4 2 3 5: Every other remaining element is sorted the underlined elements are sorted.

Second run complete Third run 1 2 3 4 5: Third run complete sorting complete. The reason that such a complicated method is used is the insert sort does not necessarily require exchanging of elements. For example, consider the following situation. Case A: It is a process in which a function calls itself from within itself. Hence, the amount of processing in insertion sort depends on how the elements are originally ordered.

If the root element is picked, we can obtain the maximum value while the remaining elements can be re-structured to form a heap. We can again pick the root, which gives us the element with the second largest value. In other words, by repeating root extraction and re-structuring the heap, sorting can be achieved. This sorting method using a heap is called heap sort. String search means the process of looking for a designated sequence of characters in a text character string. In most cases, strings are in arrays where each cell stores one character and is referenced by index.

Two arrays are then given: The algorithm then searches for the pattern string in the string of the text. It is obvious by visual inspection, but it is actually rather difficult to create an algorithm to check this. This is a concept identical to that of linear search. The search ends when the last character of the array is compared with the last character of the string to be found.

Below is a specific explanation using an example. When answering a question, the crucial point is to grasp how to use the indexes. If the pattern and a string of the text do not match up, the number of characters that can be skipped depends on the right-end character of the search range of the text being compared. The example discussed here has a 3-character pattern, so the number is 2 for X, 1 for Y, and 3 for Z or any other characters. These need to be calculated before the string search begins.

A graph algorithm is an algorithm where the search is performed on a tree, one of the question-oriented data structures. The depth-first order frequently appears on the exams, so be sure that you understand how to pick out the nodes using this method.

A graph consists of nodes and edges. Below is an example of a graph. Below, the number at each node indicates the order in which the nodes are traversed.

A question-oriented data structure is a data structure often used to create a program. Since the algorithms using data is well-established, such a structure enables the programmer to write a program with few errors. Examples of question-oriented data structures include trees, stacks, queues, and lists. Depending on the timing when the nodes are traversed, it can be classified as shown in the following table. Search method Order in which nodes are traversed Pre-order Parent, left child, right child, in this order In-order Left subtree, parent, right subtree, in this order Post-order Left subtree, right subtree, parent, in this order.

Pre-order In-order Post-order. It is probably not very clear yet what the rules are for each of the search types, so let me add some explanation. In depth-first order, the search follows the order as shown below:. In pre-order, the node values are taken out whenever you traverse the left side of the nodes. Understand well how the nodes are taken out in pre-order, in-order, and post-order. Quiz Q1 In binary search, when the number of sorted data values is quadrupled, how much does the maximum number of comparisons increase by? Q2 Explain the characteristics of each of the sorting methods: A2 Shell sort: Elements of the array are picked at certain intervals first and are sorted; then, more elements are picked by reducing the intervals and are sorted.

Bubble sort: Adjacent elements are compared and exchanged if the order is not correct; this process is repeated. Quick sort: An intermediate median reference value is chosen, and the array is divided into the elements larger than the reference value and those smaller than the value; within each portion, the same process is repeated.

Heap sort: The unsorted portion is expressed as a subtree, from which the largest or the smallest value is taken out and moved to the already sorted portion. This process is repeated to reduce the unsorted portion. Question 1 Difficulty: There is a register which stores values in binary. How many times as large as x is the resulting register value? Here, assume that overflow due to shifting will not occur. Shifting 2 bits to the left is to multiply by 22, so if we let y be the calculation result, y is related to x by the following equation: Shifting 1 bit to the left multiplies the value by 21, so the result would be as follows: Shifting 2 bits to the left multiplies the value by 22, and shifting 1 bit to the left multiplies the value by 21, so the following would result: Question 2 Difficulty: Which of the following is an appropriate description concerning the cancellation of significant digits?

Cancellation of significant digits is a phenomenon in which higher-order significant digits are lost in subtraction involving two values of the same sign which are close and in addition involving two values of the opposite signs whose absolute values are close. It occurs because computers process all numbers with only a finite number of digits.

For instance, it occurs in the following calculation:. Here, the higher-order digits become 0, reducing the number of significant digits drastically. Question 3 Difficulty: Then we check to see which of the expressions in the answer group matches has the identical results with the given logic operation:.

Question 4 Difficulty: BNF notation is used as a way to formally denote the syntax of a programming language. Overview of BNF notation is as follows:. Question 5 Difficulty: A key is composed of 3 alphabetic characters. A hash value is the result of converting the key by a hash function, which is used for hashing. Here, the function used to obtain the address is called a hash function. If hashing generates the same hash value for two or more different keys, it is called a collision.

Records that came in later when a collision occurred are called synonyms. Question 6 Difficulty: In the heap shown below, the value of a parent node is less than the values of child nodes. When inserting a node into this heap, an element is added at the very end. If that element is less than the parent node, the parent and child are exchanged with each other.

Add the element to the given position and then repeat the procedure to exchange the child and the parent when the child element has a value smaller than the parent value. Now, the heap is complete. Question 7 Difficulty: A stack is a data structure of the type known as Last-In First-Out, where data stored last will be the first data to be taken out. This is the method of paging-out which discards the least recently accessed page. Question 8 Difficulty: The decision table below shows the conditions for creating reports from employee files.

Which of the following can be concluded from this decision table? In the following explanation, the underlined parts indicate negation N. Hence, this description is wrong. There is no intersection. Organizing all of the output criteria for all of the reports from a , b , and c in the answer group, we get the following: Report 1: Therefore, no other reports contain those persons contained in Report 4.

This is the correct description. Question 9 Difficulty: Answer 9 Correct Answer: However, you need not know this algorithm; all you have to do is to track how the data changes. The algorithm then determines which is greater and subtracts the smaller from the larger.

Note that the values must be compared first before the subtraction takes place. Hence, the comparison L: S occurs 4 times. S occurs 3 times here. S occurs 2 times here. We can now add the numbers from 1 through 4. Question 10 Difficulty: When the algorithms described by the two flowcharts below are performed on a positive integer M, which of the following conditions needs to be inserted in the box below so that the same value x can be obtained?

Operation Note: The repetition specification in the loop limit denotes the following. Variable name: This means that the value of n changes from M, M — 1, M — 2, …, 2, and 1. Let us follow the flowchart on the left first. Let us track how the value of x changes as n changes:. M factorial. On the other hand, consider the flowchart on the right. This is also factorial calculation, beginning with 1. Let us now specifically track how x changes with respect to the value of n.

As in the flowchart on the left, the initial value of x is 1. Further, each time the loop is executed, the value of n increases by 1. The underlined part in each line below is the previous value of x:. Let us consider how large n should be in order to make the result identical to the result of the flowchart on the left.

The multiplication begins with M here; on the right, the multiplication begins with 1. Hence, as shown below, if the multiplication continues until M, the results of the two flowcharts will be identical:.

Chapter Objectives A computer system is composed of hardware and software. There are many types of computer, but the principles of their operation are fundamentally the same. We will learn the mechanism of computers hardware in Section 1 and software operating system for efficient computer use in Section 2. We will further learn some configurations of computer systems for achieving improved reliability in Section 3 and ways to evaluate the performance of computers in Section 4.

Finally, in Section 5, we will learn various systems that use computers. Computer Systems. Hardware is defined as devices with which a computer is configured.

In this section, we will explain these units from the standpoint of hardware. Semiconductor memory is memory made of integrated circuits ICs using semiconductors. Types and characteristics of ROM are shown in the following table.

Type Name Characteristics, etc. Mask ROM Data is written at the time of manufacturing. It cannot be re-written later.

All the data can be erased using ultraviolet rays. Fundamentals of Engineering Supplied Reference Handbook. Randall N. Rules of Thumb for Chemical Engineers: A Manual of Quick. Water Resources.. Transportation Problems. Michael Lindeburg. Bruce A. Engineering Reference Manual Series. Civil PE Sample Examination. Marta Vasquez. Norman Voigt. Wane Schneiter. Majid Baradar. PE Sample Questions and Solutions: Civil Engineering. Christine A. Carl Branan.. Seismic Design of Building Structures: National Electrical Code Handbook. Electrical Engineering Handbook. John A. Merle C. Edward Karalis. Robert B.. Donovan Young. Lincoln D. Electrical Engineering License: Problems and Solutions. Mark W. Electrical Engineer's Portable Handbook. Merle Potter. Handbook of Environmental Engineering Calculations. EIT Industrial Review: Mechanical PE Sample Examination. Andrew L. Structural Engineering Handbook. Michel Saad.

Harriet G. Brown's Boundary Control and Legal Principles. Curtis M. Structural Engineering License Review: Daniel Deckler..

Land Surveyor Reference Manual. Alan Williams. Jan Van Sickle. Handbook of Mechanical Engineering Calculations. Tyler Gregory Hicks. Keith E.. FE prep books. Flag for inappropriate content. Related titles. Jump to Page. Search inside document.

Guides with reader recommendations are in bold. Get these supervisory guides and references: Juan Dela Cruz. Adam Wilkins. Odion Okojie. Abuali Ahmad Abuali. Sanki Nadarajan. Islam Unity. Mahmoud Helmy. Robby Renz. Pawan Kumar. Nithin Krishna. Yaser Akar. Hasen Bebba.