• Result
  • Today's Puzzle
    • Previous Puzzles
    • Prize & Rules
  • Discussion Board
    • Suggestion Board
    • Trending Articles
  • Maths Tricks
  • Placement Papers
    • Placement Questions
    • Interview Experience
    • Placed user Comment
    • Group Discussion
  • English APP
  • login
  • Result
  • Today's Puzzle
    • Previous Puzzles
    • Prize & Rules
  • Discussion Board
    • Suggestion Board
    • Trending Articles
  • Maths Tricks
  • Placement Papers
    • Placement Questions
    • Interview Experience
    • Placed user Comment
    • Group Discussion
  • Walkins
    • Corporate Job Exam
    • Government Job Exam
    • Entrance Exam
  • Training
    • Internship
  • Placement Questions
  • /
  • DATA STRUCTURE

Frequently Asked DATA STRUCTURE interview questions and answers for freshers Page 3

DATA STRUCTURE Select Another Category Select Another Topic

Programming and Technical

  • Android 118
  • ASP.NET 60
  • C 459
  • C++ 448
  • DATA STRUCTURE 66
  • DBMS 77
  • ELECTRONICS 39
  • Java 261
  • OOPs Concepts 117
  • Operating Syst 103
  • RDBMS 109
  • UNIX 70

DATA STRUCTURE Question Topics

    Logical Reasoning (3)

  • Coding Decoding (1)
  • Decision Making and Problem Solving (1)
  • Number Series (1)
  • Programming (63)

  • Arrays (1)
  • Basics (1)
  • Definition (4)
  • Output (1)
  • Technical (54)
Keep an EYE (0)
Solved Question (3) UnSolved Question (63)
Pages: 7FirstPrev1234567NextLast
Advertisements

(#M40167068) DATA STRUCTURE QUESTION Move all zeros present in an array to the end Keep an EYE Keep an eye puzzle Keep an eye puzzle

EXAMPLE:
Input=['1','0','1','2','3','0','3','4','0']
Output:
['1', '1', '2', '3', '3', '4', '0', '0', '0']

// Function to move all zeros present in the array to the end
void reorder(int A[], int n)
{
// k stores index of next available position
int k = 0;

// do for each element
for (int i = 0; i < n; i++)
{
// if current element is non-zero, put the element at
// next free position in the array
if (A[i] != 0)
A[k++] = A[i];
}

// move all 0's to the end of the array (remaining indices)
for (int i = k; i < n; i++)
A[i] = 0;
}

// Move all zeros present in the array to the end
int main(void)
{
int A[] = { ..... };
int n = sizeof(A) / sizeof(A[0]);

reorder(A, n);

for (int i = 0; i < n; i++)
printf("%d ", A[i]);

return 0;
}

Asked In DATA STRUCTURE SUDHEER BABU PALLANTI (4 years ago)
Unsolved
Is this Puzzle helpful?   (2)   (0) Submit Your Solution

(#M40019021) DATA STRUCTURE QUESTION DATA STRUCTURE QUESTIONS Keep an EYE Keep an eye puzzle Keep an eye puzzle

What is the maximum total number of nodes in a tree that
has N levels? Note that the root is level (zero)

Asked In DATA STRUCTURE (12 years ago)
Unsolved Read Solution (6)
Is this Puzzle helpful?   (3)   (0) Submit Your Solution Technical
Advertisements

(#M40019023) DATA STRUCTURE QUESTION DATA STRUCTURE QUESTIONS Keep an EYE Keep an eye puzzle Keep an eye puzzle

A list is ordered from smaller to largest when a sort is
called. Which sort would take the longest time to
execute?

Asked In DATA STRUCTURE (12 years ago)
Unsolved Read Solution (3)
Is this Puzzle helpful?   (2)   (2) Submit Your Solution Technical

(#M40019028) DATA STRUCTURE QUESTION DATA STRUCTURE QUESTIONS Keep an EYE Keep an eye puzzle Keep an eye puzzle

Which sort show the best average behavior?

Asked In DATA STRUCTURE (12 years ago)
Unsolved Read Solution (8)
Is this Puzzle helpful?   (4)   (1) Submit Your Solution Technical

(#M40151276) DATA STRUCTURE QUESTION Data structure Keep an EYE Keep an eye puzzle Keep an eye puzzle

Which of these data structure allow elements to be added or removed at either end but not in the middle
a) linked lists b)Deque
c)stack d)Queue

Asked In DATA STRUCTURE kranthi kanchanapally (10 years ago)
Unsolved Read Solution (20)
Is this Puzzle helpful?   (22)   (5) Submit Your Solution Definition

(#M40019024) DATA STRUCTURE QUESTION DATA STRUCTURE QUESTIONS Keep an EYE Keep an eye puzzle Keep an eye puzzle

A list is ordered from smaller to largest when a sort is
called. Which sort would take the shortest time to
execute?

Asked In DATA STRUCTURE (12 years ago)
Unsolved Read Solution (4)
Is this Puzzle helpful?   (8)   (4) Submit Your Solution Technical

(#M40151840) DATA STRUCTURE QUESTION Keep an EYE Keep an eye puzzle Keep an eye puzzle

In the game of Jack Straws, a number of plastic or wooden "straws" are dumped on the table and players try to remove them one-by-one without disturbing the other straws. In the question here, we are concerned with the following, related problem: First n straws are dumped on the table. Next, for every pair of straws, we want to determine if the straws are connected by a path of touching straws. In other words, given a list of the endpoints for n > 1 straws (as if they were dumped on a large piece of graph paper), determine all the pairs of straws that are connected. Note that touching is connecting, but also two straws can be connected indirectly via other connected straws. Give an algorithm to compute all the pairs of straws that are connected.
Here is some additional information that you can use:
i. As a basic step you need to determine whether two straws directly touch (intersect), i.e., whether straw ab with end points a and b intersects with straw cd (with end points c and d).
ii. To get full credit also explain how the elementary step i) can be done. If you cannot find an algorithm for this step, assume an O(n 2 ) algorithm and explain how to find all pairs of straws that are connected.
Analyse and explain the worst-case computational complexity of your algorithm in terms of n.

Asked In DATA STRUCTURE aditi yadav (10 years ago)
Solved Kostav Chaudhuri Read Solution (1)
Is this Puzzle helpful?   (3)   (6) Submit Your Solution Technical

(#M40151839) DATA STRUCTURE QUESTION Keep an EYE Keep an eye puzzle Keep an eye puzzle

You are planning the group seating arrangement for a open book test given a list of students, V from different schools to participate. Assuming the fact that students who are known to each other directly or indirectly will probably cheat more as compared to unknown people sitting together.
Suppose you are also given a lookup table T where T[u] for u ? V is a list of students that u knows. If u knows v, then v knows u. You are required to arrange the seating such that any student at a table doesn't knows any other student sitting at the same table either directly or through some other student sitting at the same table. For example, if x knows y, and y knows z, then x, y, z can sit at the same table. Describe an efficient algorithm that, given V and T, returns the minimum number of tables needed to achieve this requirement. Analyze the running time of your algorithm.

Asked In DATA STRUCTURE aditi yadav (10 years ago)
Unsolved Read Solution (1)
Is this Puzzle helpful?   (8)   (3) Submit Your Solution Technical

(#M40155910) DATA STRUCTURE QUESTION Which of the following data structure is best for level by level order traversal in Binary tree? Keep an EYE Keep an eye puzzle Keep an eye puzzle

Which of the following data structure is best used for level by level order traversal in Binary tree?
[1] Queue
[2] Stack
[3] Array
[4] None of the above

Asked In DATA STRUCTURE Rishikesh Agrawani (9 years ago)
Unsolved Read Solution (5)
Is this Puzzle helpful?   (11)   (5) Submit Your Solution Technical

(#M40151838) DATA STRUCTURE QUESTION Keep an EYE Keep an eye puzzle Keep an eye puzzle

Your job is to build a data structure to maintain a set of photographs. Your photograph database should allow you to insert and search for photographs, as well as to designate some of the photographs as favourites by marking them. In more detail, your data structure should support the following operations:
• Insert(x, t, m): inserts photograph x that was taken at time t. If m = 1, then the photograph is marked as a favourite; if m = 0, then it is not a favourite.
• Search(t): find the next photograph taken after time t.
• NextFavorite(t): find the next photograph taken after time t that is a favourite.
Give a data structure for solving this problem, and explain how it works. For more efficiency, your data structure should be both time and space efficient: more points will be given for more efficient solutions. (Remember that the photographs themselves may be quite large.) Give the performance (i.e., running time) of each operation and the space usage of the data structure. You may assume that at any given time t, your camera has taken at most one photograph x. Describe your solution in words, or very high-level pseudocode. You do not need to provide complete details. You must provide enough detail, however, that your solution is clear.

Asked In DATA STRUCTURE aditi yadav (10 years ago)
Solved gaurav Read Solution (4)
Is this Puzzle helpful?   (8)   (1) Submit Your Solution Technical
Keep an EYE (0)
Solved Question (3) UnSolved Question (63)
Pages: 7FirstPrev1234567NextLast
  • Login
  • Register

Resend

Sponsored Links

Advertisements

Challenger of the Day

no image
Dimple
India
Punjab
Time: 00:01:33
Points
19

Maths Quotes

Mathematics is not a hurdle...It is a tool to achieve your goals .

Unknown

The pulse of the earth is mathematics

Hithesh

Placed User Comments

M4Math helped me a lot.

Vipul Chavan 5 years ago

Thanks m4 maths for helping to get placed in several companies.
I must recommend this website for placement preparations.

yash mittal 5 years ago

Now enjoy Offline Access of latest Question.

Get M4maths app to avail expert's solution and latest selected questions.

Download m4maths app now

  • 2533K+Registerd user
  • 1774K+Engineers
  • 759K+MBA Asprirant
  • 3K+Enginnering College
  • 250+Company Exam
  • 150K+Interview Questions
  • Site Links
  • Home
  • Result
  • Today's Puzzle
  • Discussion Board
  • Maths Tricks
  • Advertise with us
  • Contact Us
  • Useful Info
  • Maths Quotes
  • Previous Puzzles
  • Prize
  • Privacy Policy
  • Disclaimer and Copyright
  • Terms and Conditions
  • Sitemap
  • Placement papers
  • TCS Placement Paper
  • HCL Placement Paper
  • INFOSYS Placement Paper
  • IBM Placement Paper
  • SYNTEL Placement Paper
  • TECHNICAL Interview
  • HR Interview
All rights are reserved to @m4maths.com