100% satisfaction guarantee Immediately available after payment Both online and in PDF No strings attached 4.6 TrustPilot
logo-home
Exam (elaborations)

CNIT 315 EXAM 2 QUESTIONS AND ANSWERS

Rating
-
Sold
-
Pages
25
Grade
A+
Uploaded on
10-01-2026
Written in
2025/2026

CNIT 315 EXAM 2 QUESTIONS AND ANSWERS

Institution
CNIT 315
Module
CNIT 315










Whoops! We can’t load your doc right now. Try again or contact support.

Written for

Institution
CNIT 315
Module
CNIT 315

Document information

Uploaded on
January 10, 2026
Number of pages
25
Written in
2025/2026
Type
Exam (elaborations)
Contains
Questions & answers

Subjects

Content preview

CNIT 315 EXAM 2 QUESTIONS AND ANSWERS



1. Why does a pointer have to point back to the same type?- Answers - It is self-
referencing

2. Insertion Sort- Answers - Has a key value, doesn't swap every out of place numbers, only swaps the
biggest number that's out of order, faster than bubble sort.
3. Bubble Sort- Answers - slowest sort, higher numbers bubble up to top, like champaign
4. Selection sort- Answers - The smallest value is initially selected from the complete list of data and exchanged
with the first element in the list. The same thing happens with the next smallest value on the list. which gets exchanged with
the second smallest element on the list.
5. Why Does Null not need memory refrence?- Answers - It's a special character that signifies end
of list

6. Computer memory one dimensional array- Answers - Val 0 --> val 1 --> val 2 --> ...val n Value
by Value

7. computer memory two dimensional array- Answers - val 0 --> row 1 ..> row 2 --> ...row n row by
row

8. What makes sorts expensive?- Answers - How
often you swap data Writing to memory takes a lot of resources
9. Linked lists requirement- Answers - need a start pointer
10. Which is correct for the following pointer- Answers - struct
Node *Start; Start = NULL or Start.Next = NULL?- Answers -
Start = NULL
11. Malloc () Function- Answers - Allocates space, can be used interchangeably with Calloc () function,
The space allocated for this function comes from the computer's heap
12. Malloc () Function Purpose- Answers - is the more general purpose of two functions.



,13. Calloc () Function- Answers - Reserves space of array, can be used interchangeably with Malloc () function.
Initializes the allocated memory to all zeros and malloc does not.
14. Calloc () Function Advantage- Answers - It initializes all newly allocated numeric memory to 0 and
character allocated memory to NULL.
15. Realloc () Function- Answers - relocating
16. Free () Function- Answers - clean up memory
17. type def () Function- Answers - struct
18. Traverse Function- Answers - crossover, go to start and go til end, visit every node of list
19. display Function- Answers - print out content of each node
20. Binary Search- Answers - logarithmic algorithm, data gets bigger, grows ditterently


0(log2n)

21. Linear Search- Answers - (Also known as sequential search) Each item on list is examined in the order it
occurs until desired amount is located or the end of list is reached.






, 22. NULL Character- Answers - escape sequence, 10 is automatically appended to all strings by the compiler.
23. Three Dimensional Arrays- Answers - Can be viewed as a book of data tables (third subscript is called
the rank)

24. Data Structures- Answers - Every search you do
25. Static Structures- Answers - Fixed Size (don't change), like arrays
26. Dynamic Structures- Answers - Variable Size, grows and shrinks, less ettort,
more overhead "array list" <- not any array because it can have 0 elements
27. Memory Allocation- Answers - Created during compile time
28. Dynamic Allocation- Answers - Memory requests are made for allocation and releases memory space
while the program runs (also known as Run-time allocation).
29. Linked List- Answers - grows and shrinks, depend on what your doing, set of structures , (a.k.a. Self-
referencing structure)
30. Stack- Answers - Special type of linked list in which objects can only be added to and removed from the top of
the list - Last-in, First-out (LIFO) list.

in a true stack, the only item that can be seen and accessed is the top item.

31. Push- Answers - Put things on a stack, can push unlimited amount of things other than the physical limit of
computer. Is basically AddFront
32. Pop- Answers - Take things ott a stack, limit is the number of elements in the list. Is basically a Delete Node
33. Destructive (alter-stack)- Answers - Pop and Push
34. Non-Destructive (Don't alter-stack)- Answers - Peek, IsEmpty, Size
35. IsEmpty (function)- Answers - returns false, > 1 Element, is tied to Pop, Dequeue and size.
36. Peek- Answers - Sees value at top of stack, doesn't change anything, basically an indirection operator
37. Queues- Answers - Relies on linked structures, items are removed from a queue in the order in which they were
entered. First-in, First-out (FIFO) structure

Get to know the seller

Seller avatar
Reputation scores are based on the amount of documents a seller has sold for a fee and the reviews they have received for those documents. There are three levels: Bronze, Silver and Gold. The better the reputation, the more your can rely on the quality of the sellers work.
Greaterheights Birkbeck, University of London
Follow You need to be logged in order to follow users or courses
Sold
1126
Member since
3 year
Number of followers
880
Documents
18641
Last sold
1 day ago

4.1

218 reviews

5
120
4
43
3
24
2
10
1
21

Recently viewed by you

Why students choose Stuvia

Created by fellow students, verified by reviews

Quality you can trust: written by students who passed their exams and reviewed by others who've used these revision notes.

Didn't get what you expected? Choose another document

No problem! You can straightaway pick a different document that better suits what you're after.

Pay as you like, start learning straight away

No subscription, no commitments. Pay the way you're used to via credit card and download your PDF document instantly.

Student with book image

“Bought, downloaded, and smashed it. It really can be that simple.”

Alisha Student

Frequently asked questions