Docsity
Docsity

Prepare for your exams
Prepare for your exams

Study with the several resources on Docsity


Earn points to download
Earn points to download

Earn points by helping other students or get them with a premium plan


Guidelines and tips
Guidelines and tips

Exam Questions for Electronic Engineering Students: Computer Science Part, Exams of Computer Science

Exam questions for students in the bachelor of engineering (honours) in electronic engineering program, specifically for the computer science module. The exam covers topics such as linked lists, passing by value and reference, memory management, and sorting algorithms. Students are required to answer question 1 and three other questions, each worth a specified percentage of the total marks. The exam is conducted by mr. O’donovan, dr. Foley, and prof. Hurley.

Typology: Exams

2012/2013

Uploaded on 03/30/2013

lallit
lallit 🇮🇳

4

(29)

134 documents

1 / 4

Toggle sidebar

Related documents


Partial preview of the text

Download Exam Questions for Electronic Engineering Students: Computer Science Part and more Exams Computer Science in PDF only on Docsity! Cork Institute of Technology Bachelor of Engineering (Honours) in Electronic Engineering – Stage 2 (EELXE_8_Y2) Summer 2008 Computer Science (Time: 3 Hours) Answer Question 1 and THREE other questions. All questions carry equal %. Examiners: Mr. D. O’Donovan Dr. S. Foley Prof. W. Hurley 1. (a) A traffic monitoring system is required to determine the behaviour of motorists in the Cork city area. The system requires the entry from the keyboard of the: model make registration number as the cars pass an observation point. Using a linked-list approach, define a C language data structure capable of storing the above information. [4 %] (b) Write a function which will add an entry to the linked list. [8 %] (c) Determine the number of Volvo cars which passed the observation point. [6 %] (d) Delete the list. [7 %] 2 2. (a) Describe the mechanism of passing by value as used in C. Use an example and appropriate memory diagrams (C name, memory address and contents) to illustrate your answer. What is the drawback of this approach when trying to return multiple pieces of information from a function? [5 %] (b) Subsequently, describe the mechanism referred to as passing by reference. Use appropriate memory diagrams in your description. [5 %] (c) Given the following lines of C code: #include<stdio.h> #include<stdlib.h> #include<malloc.h> void Function (float **h); void main(void) { float *y; Function(&y); free(y); } void FunctionCall(float **h) { *h = (float *)malloc(sizeof(float)); } C Name Address in Memory y 0xFFFFA0 h 0xFFFFA4 Value returned from malloc 0xFFEBFC Table 3-1 (i) Using memory diagrams, in conjunction with the addresses supplied in Table 3-1 illustrate the variable assignments that occur in the above program. [7 %] (ii) Why is the double star i.e. ‘**’ notation required? [3 %] (d) Using the unsorted sequence, A={2, 8, 5, 9, 3}, illustrate the operation of the Insertion Sort pseudocode supplied paying particular attention to the array, A, indexes (1- length[A]) Insertion Sort (A) for j←2 to length[A] do key←A[j] i←j-1 while i>0 and A[i] >key do A[i+1] ←A[i] i←i-1 A[i+1]←key [5 %]
Docsity logo



Copyright © 2024 Ladybird Srl - Via Leonardo da Vinci 16, 10126, Torino, Italy - VAT 10816460017 - All rights reserved