Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Question 4 4 . a For a linear array with a circular buffer, what is the complexity in big O notation for adding an item
Question
a
For a linear array with a circular buffer, what is the complexity in big O notation for adding an item and the complexity in big O notation for removing an item? Explain your answers.
marks
b
You are given two priority queues with integers each. Describe in words how you would efficiently merge them into one priority queue. What is the time complexity of your method in big O notation?
marks
c
Consider the directed granh shown below:
Consider the directed granh shown below:
i State whether is nonconnected, weakly connected, or strongly connected.
Explain your answer.
marks
ii Write down the order in which the nodes are visited during depthfirst traversal, starting at node Include the symbol uarr wherever the traversal is forced to back up to a previous node as covered in lecture You can assume that adjacent nodes are selected in increasing order of their value.
marks
iii. How many arcs are there in the complementary graph of
marks
d
This question is about thn fnll ina mn
i What is the sequence of nodes visited by the postorder traversal?
marks
ii How many zeros are there in the adjacency matrix representation of this tree?
marks
iii. You are given a pointer to the root node of the above tree. Describe a method to create a new tree where for each node in the whole tree you swap the left and right child nodes.
marks
Total Marks
iv How many subgraphs of are there that have exactly two nodes? Explain your
answer.
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started