[go: up one dir, main page]

0% found this document useful (0 votes)
22 views2 pages

Data Structures Take Home Assignment

The document is a take-home assignment for a Data Structures and Algorithms course at the University of Juba, with questions covering array address calculations, linked list operations, tree classifications, Cartesian products, and implementations of linked lists and stacks in C++. It includes specific tasks such as calculating memory addresses, searching and modifying linked lists, identifying tree types, and explaining data structure concepts. The assignment emphasizes practical applications of data structures and algorithms in programming.

Uploaded by

Alexander Erneo
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
22 views2 pages

Data Structures Take Home Assignment

The document is a take-home assignment for a Data Structures and Algorithms course at the University of Juba, with questions covering array address calculations, linked list operations, tree classifications, Cartesian products, and implementations of linked lists and stacks in C++. It includes specific tasks such as calculating memory addresses, searching and modifying linked lists, identifying tree types, and explaining data structure concepts. The assignment emphasizes practical applications of data structures and algorithms in programming.

Uploaded by

Alexander Erneo
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 2

University of Juba

DATA STRUCTURES AND ALGORITHMS


TAKE HOME ASSIGNMENT
Deadline: Just before DSA Examination

Question One:

a) The base address of the array is 2854 and it’s of maximum length of 10 and was
declared as a float type. Assuming the computer stores a float in 2 words, calculate
the address of h [9].
b) Explain how the computer stores an array in memory when execution of the program
starts.

Question Two:
Using the linked list below, answer the following questions:

a) Draw each step with cur, prev and target for searching from the head of the linked
list for a node containing 19 and if it is not present then insert a node pointed to by
target and containing 19. (5 marks)
b) Draw each step with cur, prev and target for searching from the head of the linked list
for a node containing 18 and if it is present delete it from the linked list (5 marks)

Question Three:
a) Identify the trees below as complete binary trees or not giving reasons from the
below trees. (4 marks)
b) List all the conditions that a tree must meet to become a complete binary tree (6 marks)

c) Show the results of traversing the binary tree above using each of the following
traversal techniques:
i) Pre-Order traversal
ii) In-Order traversal
iii)Post-Order traversal
Question Four:
Suppose we wish to retain the sales of 3 types, A, B & C of French bread over a weekend
as shown in the table below:

a) Define what a Cartesian product is and calculate its value for the above two-
dimensional array above.
b) Distinguish between a row major and column major implementation of a 2-
dimensional array at the hardware level i.e. in memory.
c) Use the row major technique to find the address of the quantity of type C bread
sold in day 2.
Question Five:
a) Define the ADT Linked List.
b) Use linked list to implement the stack data structure using C++ language.
c) Repeat part b) above using a sequential list.

You might also like