0% found this document useful (0 votes)
26 views8 pages

CS301 QUIZ#1 by HB (@studywithhamza25) - 2

Uploaded by

Tayyba
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
26 views8 pages

CS301 QUIZ#1 by HB (@studywithhamza25) - 2

Uploaded by

Tayyba
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 8

1.

Convert the given infix form: 12 + 60


– 23 of expression in postfix form.
a. 12 60 + -23
b. 12+ 60 23 –
c. +12 60 - 23
d. 12 60 + 23 –
2. Each operator in a postfix
expression refers to the previous
________ operand(s).
a. two
b. four
c. three
d. one
3. Which of the following is known as
"Last-In, First-Out" or LIFO Data
Structure?
a. Stack
b. Queue
c. Tree
d. Linked List
4. Which operation of queue data
structure is used to insert an element
into the Queue?
a. enqueue()
b. dequeue()
c. remove()
d. front()
5. Suppose a Stack class has been
defined using template. Now, we want to
declare a Stack object of an int type.
What will be the correct syntax?
a. Stack<int> stack;
b. Stack int stack;
c. int Stack stack ;
d. <int>Stack stack ;
6. The usage of the class of a data
structure causes the code of the
program
a. Simplifies
b. Difficult
c. Lengthy
d. Complicated
7. A stack carries ___________ behavior.
a. FEFO
b. AVCO
c. LIFO
d. FIFO
8. Linked List use _____________ to
store data.
a. Array
b. Variables
c. 2-D Array
d. Linked Memory
9. In which data structure elements are
inserted at the back and removed from
the front?
a. Tree
b. Stack
c. Linked List
d. Queue
10. In the calling function, after the
execution of the function called, the
program continues its execution from
the _______after the function call.
a. Next line
b. Beginning
c. End
d. Previous line
11. int * i = new int [10];
12. Above given code will:
a. Allocate memory for 9 integers
b. Create 10 pointers of integer type
c. Allocate memory for 10
integers
d. Create an integer having value 10
13. The first step to add a node in a
linked list between the existing nodes is
a. currentNode->getNext();
b. newNode->getNext();
c. newNode->setNext();
d. newNode->setNext(currentNode-
>getNext());
14. To create a ___________ we link the
last node with the first node in the list.
a. Double linked list
b. Linked list
c. Circularly-linked list
d. List
15. "--" is a _______ operator.
a. Unary
b. Logical
c. Technical
d. Binary
16. In singly linked list “next” field of
node contains:
a. Object of next node
b. Address of next node
c. Address of head node
d. Object of current node
17. Stack.push(15) will push 15 on
_________.
a. Anywhere in the Stack
b. Top of the Stack
c. Middle of the Stack
d. Bottom of Stack
18. Which one option is associated with
the data structures?
a. Class
b. Time to perform each basic
operation
c. Function
d. Quality
19. Which of the following line of code is
incorrect?
a. float *i = float new;
b. float *i = new float;
c. float i = 60;
d. float *i = new float[3];
20. Josephus problem is resolved by the
implementation of____________.
a. Stack
b. Queue
c. List
d. Circular linked list

You might also like