Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

An abstract data type is a set of objects and a set of operations on those values. True False Flag this Question Question 210 pts

An abstract data type is a set of objects and a set of operations on those values.

True
False

Flag this Question

Question 210 pts

The link list consists of a series of nodes, which are necessarily adjacent in memory.

True
False

Flag this Question

Question 310 pts

The main difference between array and vector type in C++ ...........

while array elements can be accessed with an index, the vector elements cannot.
while array has fixed capacity, the vector size can be changed in runtime.
while array elements can be changed in runtime, the vector elements cannot.
None of the above

Flag this Question

Question 410 pts

What is the average running time of searching an element in a linked list?

O(logn)
O(n)

O(n2)

O(n3)

Flag this Question

Question 510 pts

In C++, the name of the library for implementation of common data structures is called.....

Standard Data Library
Standard ADT Library
Standard Template Library
None of the above

Flag this Question

Question 610 pts

Which of the following is not a major applications of stacks in programming?

Syntax check for compilers
Computation of postfix expressions
Conversion from Infix to Postfix notation
Sorting objects

Flag this Question

Question 710 pts

For infix to post-fix conversion procedure described in your textbook, what are the content of the stack and output for the following infix notation:

(x-y)*z

Look at the figures given below starting from left to right and top to bottom.

(Hint: please see the exercise in page 109-110 from your textbook)

Stack after ( scanned

Top

(

Bottom

Output:null

Stack after x scanned

Top

(

Bottom

Output:x

Stack after - scanned

Top

-
(

Bottom

Output:x

Stack after y scanned

Top

-
(

Bottom

Output:xy

Stack after ) scanned

Top

Bottom

Output:xy-

Stack after * scanned

Top

*

Bottom

Output:xy-

Stack after z scanned

Top

*

Bottom

Output:xy-z

No operand left

Top

Bottom

Output:xy-z*

Stack after ( scanned

Top

Bottom

Output:null

Stack after x scanned

Top

x

Bottom

Output:null

Stack after - scanned

Top

x

Bottom

Output:-

Stack after y scanned

Top

y
x

Bottom

Output:-

Stack after ) scanned

Top

Bottom

Output:-yx

Stack after * scanned

Top

Bottom

Output:-yx*

Stack after z scanned

Top

z

Bottom

Output:-yx*

No operand left

Top

Bottom

Output:-yx*z

Stack after ( scanned

Top

(

Bottom

Output:null

Stack after x scanned

Top

(

Bottom

Output:x

Stack after - scanned

Top

(
-

Bottom

Output:x

Stack after y scanned

Top

(
-

Bottom

Output:yx

Stack after ) scanned

Top

Bottom

Output:yx-

Stack after * scanned

Top

*

Bottom

Output:yx-

Stack after z scanned

Top

*

Bottom

Output:yx-z

No operand left

Top

Bottom

Output:yx-z*

None of the above

Flag this Question

Question 810 pts

When an element is pushed to a stack, the element is inserted to .........

bottom of the stack
center of the stack
top of the stack
None of the above

Flag this Question

Question 910 pts

Which of the following is not a procedure for standard stacks?

pop from stack
push to stack
enqueue
peek top of element

Flag this Question

Question 1010 pts

What is the average running time of infix to post-fix conversion using stack?

O(n)
O(logn)

O(n2)

None of the above

Flag this Question

Question 1110 pts

For the following postfix expression computation as described in your textbook: what should be the content of the stack once the first / operator is scanned:

4 2 - 6 2 / + 1 2 * +

Look at the figures given below starting from left to right.

(Hint: please see the exercise in page 106-107 from your textbook)

After - scanned

Top

2

Bottom

After 6 scanned

Top

6
2

Bottom

After 2 scanned

Top

2
6
2

Bottom

After / scanned

Top

3
2

Bottom

After - scanned

Top

-
2
4

Bottom

After 6 scanned

Top

6
2

Bottom

After 2 scanned

Top

2
6
2

Bottom

After / scanned

Top

/
2
6
2

Bottom

After - scanned

Top

2

Bottom

After 6 scanned

Top

2
6

Bottom

After 2 scanned

Top

2
6
2

Bottom

After / scanned

Top

2
3

Bottom

None of the above

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

More Books

Students also viewed these Databases questions