Answered step by step
Verified Expert Solution
Link Copied!

Question

00
1 Approved Answer

Question 1 (1 point) Javascript uses ___ notation for chaining objects and properties in a single statement. (This notation uses periods). Question 1 options: Save

Question 1 (1 point)

image text in transcribed

Javascript uses ___ notation for chaining objects and properties in a single statement. (This notation uses periods).

Question 1 options:

Save

Question 2 (1 point)

image text in transcribed

The indexOf() method returns the index of the _____ occurrence of a specified string within a string.

Question 2 options:

Save

Question 3 (1 point)

image text in transcribed

What is the time complexity of the following loop? for (var i=0; i

Question 3 options:

1)

O(n)

2)

O(n^2)

3)

O(logn)

4)

O(n logn)

Save

Question 4 (1 point)

image text in transcribed

What is the output of the following code? var fruits = ["Banana", "Orange"]; fruits.splice(1, 1); document.getElementById("demo").innerHTML = fruits;

Question 4 options:

Save

Question 5 (1 point)

image text in transcribed

A node of a Singly Linked List with property content (which is the node content) is passed to the following function - function f(n) { if (n == null) return " "; return n.content + f(n.next); } What is the output?

Question 5 options:

1)

A string of all the node content in the list for nodes after the passed node?

2)

A string of all the node content in the list for nodes after the passed node in reverse order?

3)

A string of all the alternate nodes in the list after the passed node?

4)

A string of all the alternate nodes in the list after the passed node in reverse order?

Save

Question 6 (1 point)

image text in transcribed

function Something() { this.head = null; } This is an acceptable example of

Question 6 options:

1)

A node in a singly linked list

2)

A node in a doubly linked list

3)

A singly linked list

4)

A doubly linked list

5)

A linked list of any type

Save

Question 7 (1 point)

image text in transcribed

For a linked list with 6 nodes numbered 1-6, what will be the output of the following function function f2(n){ if (n == null) return " "; var s = n.content; if (n.next != null) s += f2(n.next); return s; }

Question 7 options:

1)

1 2 3 4 5 6

2)

2 3 4 5 6

3)

2 4 6

4)

1 2 3 4 5

Save

Question 8 (1 point)

image text in transcribed

The following function applied to a linked list with the nodes 1,2, 3, 4, 5, 6 will return what? function f2(n){ if (n == null) return " "; var s = n.content; if (n.next != null) s += f2(n.next.next); s += n.content; return s; }

Question 8 options:

1)

1 4 6 6 4 1

2)

1 3 5 1 3 5

3)

1 2 3 5

4)

1 3 5 5 3 1

Save

Question 9 (1 point)

image text in transcribed

function Something() { this.next = null; this.content = null; } This is an acceptable example of

Question 9 options:

1)

A node in a singly linked list

2)

A node in a doubly linked list

3)

A singly linked list

4)

A doubly linked list

Save

Question 10 (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 10 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

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access with AI-Powered 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

Students also viewed these Databases questions