You are on page 1of 2

ACTS COMPUTER COLLEGE

P. Guevara Ave., Cor. A. Bonifacio St., Sta. Cruz, Laguna


www.actscc.edu.ph
Department of Computer Studies

PRELIM EXAMINATION
2IT-A-IT201-2CS-A-CS203-Data Structures and Algorithms
1st Semester A.Y. 2020-2021
TOTAL
Name : Carlos Felipe R. Alvaro
Date : November 03, 2020 100
GENERAL INSTRUCTIONS:
1. Read all instructions carefully.
2. Your answers can be typed using word processing application or handwritten.Save your file as
DataStructuresandAlgorithmsPrelimExam_yourfullname.
3. Submit your exam on the Google drive provided to you.
4. One hour and 30 minutes are allocated to complete the exam, including the time spent in downloading of exam and uploading of
your answers.
5. Answer the exam intelligently.

Answer the questions intelligently.


1. Is a dictionary a simple or associative container? Is the ordering a linear ordering or a weak ordering?
2. A spell checker in a program such as a word processor keeps a list of recognized spellings of known words. Is such a
collection kept as a simple or associative container?
3. A hash table that stores an associative array is sometimes described as a look-up table. For example, in C++, the
statement

Why would the preprocessor need a look-up table to store such definitions?
4. Is every linear ordering of a finite number of objects a hierarchical ordering? Is every hierarchical ordering a partial
ordering?
5. Describe the difference between an explicitly defined and an implicitly defined relation.
6. Discuss the three classifications of memory allocation.
7. Distinguish some variations of memory allocations such as Trees, Graphs,, Deques (linked arrays) and inodes
8. Which of the following are equal?

9.
Prepared by: Reviewed/Approved by: Noted by:

DR. ADOREE A. RAMOS DR. ADOREE A. RAMOS PROF. RUBEN F. MACALINAO, MBA, MM
Faculty Head, Department of Business Management President/Director
Answers:
1. A dictionary is an associative container, for it stores records and other records associated with the said record.
It is an weak ordering as most words are associated with different words that are related to a certain word,
therefore multiple groups of objects with the same or associated properties.
2. A spell checker is an simple container, for it only stores words and checks each word on a document one by
one to see any misspellings or mistakes.
3. To automatically change the value of min_value and max_value to the specified one.
4. No, a linear ordering is just a straight line that connects each value related to each other, and a partial ordering
has multiple starting points and some may have multiple records linking to that one while a hierarchical ordering
only have one starting point.
5. Implicitly defined relations are done by other codes running behind the scene while explicitly defined relations
are manual approach to change what you want by writing out the code yourself.
6. Static Memory – declaring a variable or an instance of a structure or class, the memory for that object is
allocated by the OS.
Dynamic Memory – having the OS to designate a block of memory to the appropriate size while a program is
running.
7. Dynamic Memory Static Memory

Static Memory used by the OS to

Dynamic Memory are blocks store variables or instances of


of memories used while a structure or class
program is running.
Both done

By the OS

8. i. 5^3 and 3^5

ANSWER: -> 5^3 = 125, 3^5 = 243

Are they equal? - No

ii. 8^2 and 4^3

ANSWER: -> 8^2 = 64, 4^3 = 64

Are they equal? - Yes

iii. 16^lg(4) and 4^lg(16)

ANSWER: -> 16^lg(4) = 5.30826, 4^lg(16) =5.30826

Are they equal? – Yes

Prepared by: Reviewed/Approved by: Noted by:

DR. ADOREE A. RAMOS DR. ADOREE A. RAMOS PROF. RUBEN F. MACALINAO, MBA, MM
Faculty Head, Department of Business Management President/Director

You might also like