Fill This Form To Receive Instant Help

Help in Homework
trustpilot ratings
google ratings


Homework answers / question archive / a) A Two Dimensional Array Arr[50][20] is Stored in the Memory Along the Row with Each of Its Elements Occupying 4 Bytes

a) A Two Dimensional Array Arr[50][20] is Stored in the Memory Along the Row with Each of Its Elements Occupying 4 Bytes

Computer Science

a) A Two Dimensional Array Arr[50][20] is Stored in the Memory Along the Row with Each of Its Elements Occupying 4 Bytes. Find the Address of the Element Arr[30] [10], If the Element Arr[20] [5] is Stored at the Memory Location 17000. (10 Marks)

b) An algorithm is a plan for solving a problem, but plans come in several levels of detail. It's usually better to start with a high-level algorithm that includes the major part of a solution, but leaves the details until later.

Explain how to use an everyday example to demonstrate a high-level algorithm (6 Marks) QUESTION 2

Show the series of steps taken by the merge Sort algorithm while sorting the below mentioned list of data and explain the algorithm that support the sorting.

index 0 1 2 3 4 5 6 7

value 9 20 6 10 14 8 60 11 (Marks 9)

CLO: Apply and manipulate the main sorting and searching algorithms, recursion to solve data structure problems.

QUESTION 3

int a = 0, b = 0;

for (i = 0; i < N; i++) {

a = a + rand();

}

for (j = 0; j < M; j++) {

b = b + rand();

}

Calculate the time and space complexity for the above-mentioned code. Explain the procedure for the calculation

CLO: Analyse the time and space complexity of a given algorithm. (Total Marks: 5)

QUESTION 4

a) Show the binary search tree built by adding numbers in this specific order, assuming the graph is empty to start with: 50, 20, 100, 10, 130, 30, 21, 42. An algorithm for adding these numbers in the binary tree must be created. (15 Marks)

b) Implementation of a queue is also an important application of data structure. Nowadays computer handles multiuser, multiprogramming environment and time-sharing environment by using the handling of interrupts in real-time systems. In this environment a system(computer) handles several jobs at a time, to handle these jobs the concept of a queue is used. From the above scenario find the process of queue in handling the real time. (15 Marks)

c) Web browsers often provide a history feature, which records all web pages accessed in the recent past. How is this different from the back stack? Describe how the history should change when each of the two following conditions occurs by using suitable data structures

(i) when the user moves to a new page by pressing a hyperlink (7.5 Marks)

(ii) when the user restores an old page by pressing the back button. (7.5 Marks)

d) If the test program has the following two lines of code:

const node *fred;

fred = head->link();

Which of the two link() methods is getting called? Explain in detail. (15 Marks)

CLO: Apply and manipulate the stack, queues, linked list and tree structures to solve IT related problem.

QUESTION 5

pic.jpg

Perform the depth first traversal for the above-mentioned graph and draw the graph traversal through Stack Data structure

CLO: Use the graph terminology and basic graph operations to solve data structure problems.

Purchase A New Answer

Custom new solution created by our subject matter experts

GET A QUOTE