DSA 2 HARD
Generate 2n Valid Parentesis | Manish Shaw |
Longest common prefix | Manish Shaw |
Move all occurrance of the given key to the end of the linked list | Manish Shaw |
Sorting given character Array using Linked List | Manish Shaw |
Merge two shortest Linked list | Mecharte Lavnyasai DSA2 Hard |
mecharte Lavnyasai DSA2 Hard | |
sum of minimum and maximum in subarrays | mecharte Lavnyasai DSA2 Hard |
Next larger element (Stack) | mecharte Lavnyasai DSA2 Hard |
1.Print All Possible Valid Combinations Of Parenthesis of Given ‘N’ | Manish Shaw |
2. Given an array arr[] containing N lowercase English alphabets, the task is to sort this array arr[] using a linked list. | Manish Shaw |
You are given a doubly linked list, which contains nodes that have a next pointer, a previous pointer, and an additional child pointer. This child pointer may or may not point to a separate | Ashish Sarkar (ashishsarkar94) |
doubly linked list, also containing these special nodes. These child lists may have one or more children of their own, and so on, to produce a multilevel data structure as shown in the example below. | Ashish Sarkar (ashishsarkar94) |
Ashish Sarkar (ashishsarkar94) | |
Given the head of the first level of the list, flatten the list so that all the nodes appear in a single-level, doubly linked list. Let curr be a node with a child list. | Ashish Sarkar (ashishsarkar94) |
The nodes in the child list should appear after curr and before curr.next in the flattened list. | Ashish Sarkar (ashishsarkar94) |
Return the head of the flattened list. The nodes in the list must have all of their child pointers set to null. | Ashish Sarkar (ashishsarkar94) |
Ashish Sarkar (ashishsarkar94) | |
Ashish Sarkar (ashishsarkar94) | |
Input: head = [1,2,3,4,5,6,null,null,null,7,8,9,10,null,null,11,12] | Ashish Sarkar (ashishsarkar94) |
Output: [1,2,3,7,8,11,12,9,10,4,5,6] | Ashish Sarkar (ashishsarkar94) |
Ashish Sarkar (ashishsarkar94) | |
Input: head = [1,2,null,3] | Ashish Sarkar (ashishsarkar94) |
Output: [1,3,2] | Ashish Sarkar (ashishsarkar94) |
Ashish Sarkar (ashishsarkar94) | |
1 =>2 | Ashish Sarkar (ashishsarkar94) |
| <= | Ashish Sarkar (ashishsarkar94) |
V | Ashish Sarkar (ashishsarkar94) |
3 | Ashish Sarkar (ashishsarkar94) |
/* | Ashish Sarkar (ashishsarkar94) |
// Definition for a Node. | Ashish Sarkar (ashishsarkar94) |
class Node { | Ashish Sarkar (ashishsarkar94) |
public int val; | Ashish Sarkar (ashishsarkar94) |
public Node prev; | Ashish Sarkar (ashishsarkar94) |
public Node next; | Ashish Sarkar (ashishsarkar94) |
public Node child; | Ashish Sarkar (ashishsarkar94) |
}; | Ashish Sarkar (ashishsarkar94) |
2. Contains Duplicate values in the LinkedList | Tarun Pandey |
3.Longest Palindrome in a String &check linkedlist palidrome are not | Tarun Pandey |
1) Given a string S, find the length of the longest substring without repeating characters | Varsha |
2) Generate binary numbers between 1 to `n` using a queue | |
1) Remove all the vowel from the given String. | |
input "what is your name ? " | |
output "wht s yr nm ?" | |
2) Find the common character from given stringArray . | |
input {"apple", "orange"} | |
output 'a', 'e' | |
Next Greatest Element/Next Larger Element | |
Add two linkedlist | Ashim kaushal |
anirban paul | |
Dalindrome String (https://my.newtonschool.co/playground/code/7pjrif0inqx6/) | |
Delete even nodes in circular linkedlist (https://my.newtonschool.co/playground/code/rcl0f5w7231h/) | |
Implement queue using stack | |
1) What are the different types of Strings in java | Manikantha S |
2) What are the different access modifiers in java | Manikantha S |
3) Implement a Stack using Queue | Manikantha S |
4) A palindrome is a string that remains the same if reversed. | |
4) A palindrome is a string that remains the same if reversed. | |
do 1st two perfectly next 2 if 1st two not solved,,ok | |
Code 1 - Given the head of a linked list, remove the nth node from the end of the list and return its head. Input: head = [1,3,4,7,1,2,6] Output: [1,3,4,1,2,6] Code 2 - You are given an array of integers nums, there is a sliding window of size k which is moving from the very left of the array to the very right. You can only see the k numbers in the window. Each time the sliding window moves right by one position. Return the max sliding window. Input: nums = [1,3,-1,-3,5,3,6,7], k = 3 Output: [3,3,5,5,6,7] Code 3 - The next greater element of some element x in an array is the first greater element that is to the right of x in the same array. You are given two distinct 0-indexed integer arrays nums1 and nums2, where nums1 is a subset of nums2. For each 0 <= i < nums1.length, find the index j such that nums1[i] == nums2[j] and determine the next greater element of nums2[j] in nums2. If there is no next greater element, then the answer for this query is -1. Return an array ans of length nums1.length such that ans[i] is the next greater element as described above. Input: nums1 = [4,1,2], nums2 = [1,3,4,2] Output: [-1,3,-1] Code - 4 Given an array arr[ ] of size N having distinct elements, the task is to find the next greater element for each element of the array in order of their appearance in the array. Next greater element of an element in the array is the nearest element on the right which is greater than the current element. If there does not exist next greater of current element, then next greater element for current element is -1. For example, next greater of the last element is always -1. Input: N = 4, arr[] = [1 3 2 4] Output: 3 4 4 -1 | Kishlay Kumar |
Suppose you are given two sorted linked list. Merge two linked lists in sorted order, assume no repetition of numbers(duplicate numbers) in linked list: Eg: I/p 1->2->4->5 3->6->8->9->10 o/p 1->2->3->4->5->6->8->9->10 | Shubham Bajpai |
Reverse a linked list Eg: I/p 1->2->3->4->5 O/p: 5->4->3->2->1 | Shubham Bajpai |
Find the Factorial of Given Number- solved implement a Singly linked list with Add and Display Operation | Manjunath |
Add 1 to a number represented as linked list | Rounak Goliya |
Implement a Stack using LinkedList - Write a code to check given string is Palindrome or not using Stack | Ravi Prakash |
Various operations of stack | Soumya pandith |
Different types of linked list, explain them | |
difference between peek and pop operation | |
what is a double ended queue, priority queue | |
Real life applications of stack | |
String output based question. | |
Coding Question - | |
Given a string, find the minimum number of characters to be inserted to convert it to palindrome. | |
Insert elements into a linked list and print them. | |
https://leetcode.com/problems/longest-substring-without-repeating-characters/ | Utkarsh Jain |
Application of Stack, Queue | |
Difference between Doubly linked list and circular lined list | |
wap to find string is palindrome or not | Dilip Rathod |
wap to find no. of vowels and consonents | |
wap to find middle element of linkedlist | |
Write a function detectAndRemoveLoop() that checks whether a given Linked List contains a loop and if loop is present then removes the loop and returns true. If the list doesn’t contain a loop then it returns false. Example: Input: 1 ⇒ 2 ⇒3 ⇒ 4 ⇒ 5 ⇒ 6 ⇒ 3 Output: 1 ⇒ 2 ⇒3 ⇒ 4 ⇒ 5 ⇒ 6 ⇒null Explanation: 6 is connected to 3 which makes 3 ⇒4 ⇒5 ⇒6 in loop | Shubham madheysia |
Given a string containing just the characters '(' and ')', find the length of the longest valid (well-formed) parentheses substring. Input: s = "(()" Output: 2 Explanation: The longest valid parentheses substring is "()". Input: s = "(()(()()" Output: 4 Explanation: The longest valid parentheses substring is "()()". Input: s = "" Output: 0 | |
Given a Singly Circular Linked List, starting from the first node delete all odd position nodes in it. Note: Linked list is considered to have 1-based indexing. That is, the first element in the linked list is at position 1. Examples: Input : 99 ⇒ 11 ⇒ 22 ⇒ 33 Output : 11 ⇒ 33 Input : 90 ⇒ 10 ⇒ 20 ⇒ 30 Output : 10 ⇒ 30 | |
Length of the Longest Alphabetical Continuous Substring | Tarun kumar |
Remove loop from the linkedlist | |
What is a String ? What do you understand by the term linked list ? What are different types of linked lists? Explain each and every type in detail? Difference between singly and doubly linked lists ? What do you mean by term Stack? What do you mean by term Queue? Explain main difference between Stack and Queue? Write code to implement a linked list, Add a function to remove the duplicate elements from the linked lists and then write a function to reverse the linked list, also take input from user ? | Shivam singh |
No comments:
Post a Comment