Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
0% found this document useful (0 votes)
10 views

data structure and algorithm prelim exam

The document is a midterm examination for a Data Structure and Algorithms course, scheduled for October 9, 2023. It includes multiple-choice questions, enumeration tasks, and coding exercises related to data structures, algorithms, and C++ programming. The exam assesses students' understanding of various data types, structures, recursion, and coding skills.

Uploaded by

jervai
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
10 views

data structure and algorithm prelim exam

The document is a midterm examination for a Data Structure and Algorithms course, scheduled for October 9, 2023. It includes multiple-choice questions, enumeration tasks, and coding exercises related to data structures, algorithms, and C++ programming. The exam assesses students' understanding of various data types, structures, recursion, and coding skills.

Uploaded by

jervai
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 3

MIDTERM EXAMINATION

October 9, 2023, 2:30-4:00pm, ROOM 2


Subject: DATA STRUCTURE AND ALGORITHMS
1st semester
NAME: ____________________________________________________ Course & Year: ______________________
I. Multiple Choices: Write the letter of the correct answer.
_______ 1.It is a set of values or values in a particular format that refers to a single set of item values.
a. Graph b. Architecture c. Data
_______ 2. ID, Age, Gender, First name, Middle name, Last name, Street, and Area are examples of?
a. Individual data items b. Group data items c. Elementary data items
_______ 3. Name and Address are examples of _____________?
a. Individual data items b. Group data items c. Elementary data items
_______ 4. It is a specific way of storing and organizing data in the computer’s memory so that these data can be
easily retrieved and efficiently used when needed later.
a. Data Analysis b. Data Structure c. Data Types
_______ 5. A data structure is said to be ________ if its elements combine to form any specific order.
a. Linear b. Vertical c. Horizontal
_______ 6. Linear relationship between all the elements represented using a linear memory location?
a. Arrays b. Linked Lists c. Stacks
_______ 7. Linear relationship between all the elements represented using the concept of pointers or links.
a. Arrays b. Linked Lists c. Stacks
_______ 8. It represents data with a hierarchical relationship between different elements.
a. Non-Linear data structure b. Linear data structure c. Horizontal data structure
_______ 9. Relationships between pairs of elements, which do not necessarily follow a hierarchical structure, it is
called _____________.
a. Graph b. Architecture c. Data
_______ 10. Data types that are predefined and has a fixed set of rules for declaration.
a. Built-in data types b. derived data types c. Fixed data types
_______ 11. Data types that can be implemented independently within a language.
a. Built-in data types b. derived data types c. Fixed data types
_______ 12. Every item stored in an array is termed as an ____________.
a. Index b. Object c. Element
________ 13. Each memory location of an element in an array is denoted by a numerical _______ which is used for
identifying the element.
a. Index b. Object c. Element
________ 14. It prints all the array elements one after another.
a. Deleting b. Traversing c. Sorting
________ 15. It adds an element at given index.
a. Sorting b. Inserting c. Traversing
________ 16. It is used to delete an element at given index.
a. Deleting b. Searching c. Inserting
________ 17. It searches for an element(s) using given index or by value.
a. Searching b. Updating c. Sorting
________ 18. It is used to update an element at given index.
a. Searching b. Updating c. Sorting
________ 19. File compression or file extension for a C++.
a. .c++ b. .cpp c. .exe
________ 20. The process in which a function calls itself directly or indirectly is called _________
a. Recursion b. Iteration c. Usage
________ 21. When a function is called within itself directly it is called ___________
a. Indirect Recursion b. Iteration c. Direct Recursion
________ 22. It occurs when a function calls another function that eventually calls the original function and it forms
a cycle.
a. Indirect Recursion b. Iteration c. Direct Recursion
________ 23. Recursive algorithms are used to search and sort data structures like trees and graphs.
a. Mathematical calculations
b. Searching and Sorting algorithms
c. Compiler design
________ 24. Recursive algorithms are used to solve problems such as factorial, Fibonacci sequence, etc.
a. Mathematical calculations
b. Searching and Sorting algorithms
c. Compiler design
________ 25. Recursion is used in the design of compilers to parse and analyze programming languages.
a. Artificial Intelligence
b. Searching and Sorting algorithms
c. Compiler design
________ 26. Many computer graphics algorithms, such as fractals and the Mandelbrot set, use recursion to
generate complex patterns.
a. Graphics
b. Searching and Sorting algorithms
c. Artificial Intelligence
________ 27. Recursive neural networks are used in natural language processing, computer vision, and other AI
applications.
a. Graphics
b. Searching and Sorting algorithms
c. Artificial Intelligence

II. Enumerate the following


28-31. Examples of Linear data structure (4 items)
28. __________________________________
29. __________________________________
30. __________________________________
31. __________________________________
32-36. Examples of C++ softwares
32. __________________________________
33. __________________________________
34. __________________________________
35. __________________________________
36. __________________________________

III. Coding. Analyze and write the code of the following.


a. The program will solve the grade of the student using the following grading system.
Activities : 25%
Quizzes : 25%
Examination : 50%
Total is 100%

a.1 (37-45)Analyze and write the FORMULA to get the final grade. Write your formula inside the box(9
pts)
Ex: VAT is 12% of the total purchases.
Formula: VAT = TOTAL * 12%; or
VAT = TOTAL * 0.12;
Formula:

a.2 Write the code of the given problem.


#include<iostream>
Using namespace std;
int main(){
return 0;
}

b. Write the code of the following.


The program will ask the user to enter the MIDTERM GRADE and FINAL GRADE of the student, then view
result.
Formula:
FINAL_GRADE = (MIDTERM * 0.4) + (FINAL * 0.6);

You might also like