• Wrong document? Swap it for free
  • Written by students who passed
  • Immediately available after payment
  • Read online or as PDF
Sell
Where do you study
Your language
Document preview thumbnail
Preview 3 out of 18 pages
Exam (elaborations)

Version 2 Data Structures And Algorithms I 2026 Test Paper Solved Questions And Solutions

Document preview thumbnail
Preview 3 out of 18 pages

VERSION 2 DATA STRUCTURES AND ALGORITHMS I 2026 TEST PAPER SOLVED QUESTIONS AND SOLUTIONS

Content preview

VERSION 2 DATA STRUCTURES AND
ALGORITHMS I 2026 TEST PAPER SOLVED
QUESTIONS AND SOLUTIONS

◉ Max-heap remove. Answer: Always a removal of the root, and is
done by replacing the root with the last level's last node, and
swapping that node with its greatest child until no max-heap
property violation occurs.
Complexity O(logN)


◉ Percolating. Answer: The upward movement of a node in a max-
heap


◉ Min-Heap. Answer: Similar to a max-heap, but a node's key is less
than or equal to its children's keys.


◉ Linked list vs Array. Answer: If a program requires fast insertion
of new data, a linked list is a better choice than an array.


◉ Abstract Data Type (ADT). Answer: A data type described by
predefined user operations, such as "insert data at rear," without
indicating how each operation is implemented.

,◉ List. Answer: An ADT for holding ordered data.


Data Structure Types: Array, linked list


◉ Tuple. Answer: Array Type
An immutable(fixed) container with ordered elements.


◉ Stack. Answer: An ADT in which items are only inserted on or
removed from the top of a stack.
*Last-in First-Out


Underlying data structures: Linked list


Push(stack, x), pop(stack), peek(stack), IsEmpty(stack),
GetLength(stack)


*Pop & peek should not be used on a empty stack.


◉ Stack operations. Answer: Example starting with stack: 99, 77
(top is 99).


Push(stack, x)

, Inserts x on top of stack
Push(stack, 44). Stack: 44, 99, 77


Pop(stack)
Returns and removes item at top of stack
Pop(stack) returns: 99. Stack: 77


Peek(stack)
Returns but does not remove item at top of stack
Peek(stack) returns 99. Stack still: 99, 77


IsEmpty(stack)
Returns true if stack has no items
IsEmpty(stack) returns false.


GetLength(stack)
Returns the number of items in the stack
GetLength(stack) returns 2.


◉ Queue. Answer: An ADT in which items are inserted at the end of
the queue and removed from the front of the queue.

Document information

Uploaded on
April 13, 2026
Number of pages
18
Written in
2025/2026
Type
Exam (elaborations)
Contains
Questions & answers
$13.99

Wrong document? Swap it for free Within 14 days of purchase and before downloading, you can choose a different document. You can simply spend the amount again.
Written by students who passed
Immediately available after payment
Read online or as PDF

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.
Sold
35
Followers
1
Items
23082
Last sold
3 days ago



Why students choose Stuvia

Created by fellow students, verified by reviews

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

Didn't get what you expected? Choose another document

No worries! You can instantly pick a different document that better fits what you're looking for.

Pay as you like, start learning right 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 aced it. It really can be that simple.”

Alisha Student

Working on your references?

Create accurate citations in APA, MLA and Harvard with our free citation generator.

Working on your references?

Frequently asked questions