Search Interview Questions | More than 3000 questions in repository. There are more than 900 unanswered questions. Click here and help us by providing the answer. Have a video suggestion. Click Correct / Improve and please let us know. |
|
| ||||
Data structure - Interview Questions and Answers for 'Compro technologies' - 5 question(s) found - Order By Newest | ||||
| ||||
This question was recently asked at 'Myntra,Compro Technologies'.This question is still unanswered. Can you please provide an answer. | ||||
Help us improve. Please let us know the company, where you were asked this question : | ||||
Like Discuss Correct / Improve   Asked in 2 Companies | ||||
| ||||
Ans. First Find the number of nodes in the linked list and take it as n.then find the data at n-3 element. | ||||
Help us improve. Please let us know the company, where you were asked this question : | ||||
Like Discuss Correct / Improve  linkedlist Asked in 1 Companies | ||||
| ||||
Ans. import java.util.*; class LinkedListSolution{ protected LinkedList list; public LinkedListSolution(){ list = new LinkedList(); } public Object pop() throws NoSuchElementException{ if(list.isEmpty()) throw new NoSuchElementException(); else return list.removeFirst(); } public void push(Object obj){ list.addFirst(obj); } public Object peek() throws NoSuchElementException{ if(list.isEmpty()) throw new NoSuchElementException(); else return list.getFirst(); } public boolean isEmpty(){ return list.isEmpty(); } public String toString(){ return list.toString(); } } class TestStack{ public static void main(String args[]){ LinkedListSolution s = new LinkedListSolution(); s.push("First"); s.push("Second"); s.push("Third"); System.out.println("Top: " s.peek()); s.push("Fourth"); while(!(s.isEmpty())) System.out.println(s.pop()); } } | ||||
Help us improve. Please let us know the company, where you were asked this question : | ||||
Like Discuss Correct / Improve  Linkedlist  data structures  algorithm Asked in 2 Companies basic | ||||
| ||||
Ans. We can merge two sorted array by using quick sort algorithm | ||||
Help us improve. Please let us know the company, where you were asked this question : | ||||
Like Discuss Correct / Improve  arrays  merge sorted arrays Asked in 2 Companies | ||||
| ||||
This question was recently asked at 'Compro Technologies'.This question is still unanswered. Can you please provide an answer. | ||||
Help us improve. Please let us know the company, where you were asked this question : | ||||
Like Discuss Correct / Improve   Asked in 1 Companies | ||||