Skip to main content

Posts

Data Structure & Algorithm Interview Questions And Answers - Part X.

Here, are some sample questions based on "Data Structures". Read it carefully as these questions will help you in cracking any interview. 46) What do you mean by Polish string ? Answer:  Polish string refers to the notation in which the operator symbol is placed either before its operands (prefix notation) or after it operands (postfix notation). The usual form, in which the operator is placed in between the operands is called infix notation. 47) What do you mean by an infix, postfix and prefix expression ? Answer: An expression where operators are placed in between the operands is called a  infix expression . E.g.: A + B An expression where operators are placed after the operands is called a postfix expression . E.g.: AB+ An expression where operators are placed before the operands is called a prefix expression . E.g.: +AB 48) What is the evaluation order according to which an infix expression is converted to postfix expression ? Answer: The evaluat...

Data Structure & Algorithm Interview Questions And Answers - Part IX.

Here, are some sample questions based on "Data Structures". Read it carefully as these questions will help you in cracking any interview. 41) What do you mean by bubble sort ? Bubble sort is an array sorting technique in which the adjoining values are compared and exchanged if they are not in the proper order. The process repeats until the entire array is sorted. 42) What is insertion sort ? In insertion sort , each successive element is picked from its position and inserted at an appropriate position in the previously sorted array. 43) Differentiate between the different types of linked lists ? Linked lists are of two types viz, singly linked or one-way lists and doubly linked or two-way lists . Singly linked lists contain node with single pointer pointing to the next node in sequence whereas doubly linked lists contain two pointers , one pointing to previous node and other pointing to the next node in sequence. 44) What do you mean by ‘pushing’ and ‘pop...

Data Structure & Algorithm Interview Questions And Answers - Part VIII.

Here, are some sample questions based on "Data Structures". Read it carefully as these questions will help you in cracking any interview. 36) What are the differences between linear search and binary search ? The differences between linear and binary searches are: Binary search carries out the searching process with the minimum number of comparisons but linear search does not guarantee lesser number of comparisons. To save on time and comparisons, binary search is much more beneficial than linear search. Binary search can work for only sorted arrays whereas linear search can work for both sorted as well as unsorted arrays. 37) State the condition(s) under which binary search is applicable ? The conditions for binary search are: The list must be sorted. Lower bound and upper bound, and the sort order of the list must be known. 38) What are the advantages of linked lists over arrays ? Linked lists overcome the drawbacks of arrays as in linked ...

Data Structure & Algorithm Interview Questions And Answers - Part VII.

Here, are some sample questions based on "Data Structures". Read it carefully as these questions will help you in cracking any interview. 31) List the basic operations which can be performed on data structures ? The basic operations which can be performed on data structures are: Insertion : Addition of new element into a data structure. Deletion : Removal of a data element from a data structure. Searching : Searching for and finding a specified data element in a data structure. Traversal : Traversing along a data structure and processing all the data elements of it. Sorting : Arranging data elements of a data structure in a specified order. Merging : Combining elements of two similar data structures to form a new data structure of same type. 32) How can you calculate the size of an array, given the upper and lower bounds of the array ? When upper bound and lower bound of an array are given, its size is calculated as: Array size (length) = UB – LB + 1 ...

Data Structure & Algorithm Interview Questions And Answers - Part VI.

Here, are some sample questions based on "Data Structures". Read it carefully as these questions will help you in cracking any interview. 26) What are the different types of arrays? Arrays are of different types namely one-dimensional arrays, two-dimensional arrays and multi-dimensional arrays. One-dimensional arrays comprise of finite homogeneous elements while multi-dimensional arrays comprise of elements, each of which is itself an array. 27) What do you mean by the base address of an array? In memory, one-dimensional arrays are implemented by allocating a sequence of addressed locations so as to accommodate all its elements. The starting address of the very first element of the array is called base address of the array. 28) Give the formula to calculate the address of any element in an array, when the length of the array along with its base address and size of the element are given ? The formula to calculate address of any element in an array is: Add...

Data Structure & Algorithm Interview Questions And Answers - Part V.

Here, are some sample questions based on "Data Structures". Read it carefully as these questions will help you in cracking any interview. 21) What advantages and disadvantages, do you think does a circular singly linked list have over a non-circular singly linked list? A circular singly linked list is advantageous over a non-circular singly linked list because the former helps in sequencing from any node to any other node in the list. And the disadvantage is that it can make the end of the list more difficult to detect than if the last node contained a NULL next pointer. 22) Give the similarities between queues and stacks ? Both queues and stacks are special cases of linear lists . Both can be implemented as arrays or linked lists . 23) Differentiate between queues and stacks ? The differences between queues and stacks are: A stack is a LIFO list while a queue is a FIFO list . There are no variations of stack. A queue, however, may be circular or de...

Data Structure & Algorithm Interview Questions And Answers - Part IV.

Here, are some sample questions based on "Data Structures". Read it carefully as these questions will help you in cracking any interview. 16) What Is A Circular Queue ? Circular queues are the queues implemented in circular form rather than a straight line. In these types of queue, the last element is always followed by the first element. 17) What Do You Mean By The Terms ‘Overflow’ & ‘Underflow’ In Data Structures ? Overflow and Underflow are two states in data structures when further insertions and deletions respectively are not possible in the data structure. Overflow refers to inserting a node when no memory is available and Underflow refers to deleting from an empty list. 18) What Is Meant By Dequeue ? Queues in which elements can be added or removed at either end but not in the middle are called dequeues. There are two types of dequeue namely input restricted dequeue and output restricted dequeue. 19) What Do You Mean By Garbage Collection...