Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Question 1 (1 point) What is the output of the following function if called with the argument doFun2(7)? function doFun2(n) { // Enqueue is equivalent

Question 1 (1 point)

image text in transcribed

What is the output of the following function if called with the argument doFun2(7)? function doFun2(n) { // Enqueue is equivalent to push, Dequeue is equivalent to shift var q = []; q.push(0); q.push(1); for (var i = 0; i

Question 1 options:

Save

Question 2 (1 point)

image text in transcribed

A Stack is used when data is transferred asynchronously between two processes.

Question 2 options:

1) True
2) False

Save

Question 3 (1 point)

image text in transcribed

How many queues are needed to implement a Stack

Question 3 options:

1)

1

2)

2

3)

3

4)

4

Save

Question 4 (1 point)

image text in transcribed

In the most efficient implementation of a Queue what is best case time efficiency of the Dequeue operation

Question 4 options:

1)

O(1)

2)

O(logn)

3)

O(n)

Save

Question 5 (1 point)

image text in transcribed

What is the output of the following function if called with the argument doFun2(15)? function doFun2(n) { // Enqueue is equivalent to push, Dequeue is equivalent to shift var q = []; q.push(0); q.push(1); for (var i = 0; i

Question 5 options:

Save

Question 6 (1 point)

image text in transcribed

Linked Lists must have the size of the list determined on declaration of the list.

Question 6 options:

1) True
2) False

Save

Question 7 (1 point)

image text in transcribed

You are given pointers to first and last nodes of a singly linked list, which of the following operations are dependent on the length of the linked list?

Question 7 options:

1)

Delete the first element

2)

Insert a new element as the first element

3)

Delete the last element of the list

4)

Add a new element at the end of the list

Save

Question 8 (1 point)

image text in transcribed

What is the value of t after the following code; var a = []; var s = "COP3530";var t = ""; for (var i = 0; i

Question 8 options:

Save

Question 9 (1 point)

image text in transcribed

A traditional use of the Stack data structure is evaluation of arithmentidc expressions

Question 9 options:

1) True
2) False

Save

Question 10 (1 point)

image text in transcribed

What will be the output of the following code? var a = ["3", "2", "1"]; document.getElementById("demo").innerHTML = a.sort();

Question 10 options:

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Web Database Development Step By Step

Authors: Jim Buyens

1st Edition

0735609667, 978-0735609662

More Books

Students also viewed these Databases questions