163 subscribers
3.42K photos
24 videos
39 files
371 links
Link: @java_posts

Contact: java.response.email@gmail.com
Download Telegram
Insertion Sort Algorithm - Iterative & Recursive
#Source_code
#Data_structure
Check if a string is a rotated palindrome or not
A naive solution is to consider all rotations of the given string and check if any rotation is a palindrome or not. If we have found a rotation that is a palindrome, return true; otherwise, return false.
#Source_code
#Data_structure
code.png
563.4 KB
Determine whether a string matches with a given pattern.
Given a string and a pattern, determine whether a string matches with a given pattern. The solution should not use any regex.
#Source_code
#Data_structure
#84
Java
code.png
#Data_structure
#Output
#84
Example inputs for a given Data Structure:

Input:
string: codesleepcode
pattern: XYX

Output:
X: code
Y: sleep


Input:
string: codecodecode
pattern: XXX

Output:
X: code
Bit Hacks – Playing with the rightmost set bit of a number
#Source_code
#Data_structure
#91
Single linked list Example in Java
#Source_code
#Data_structure
#92
SinglyLinkedList2
476.6 KB
Singly Linked List Example in Java
Example 2
#Source_code
#Data_structure
#93
Binary
Print all distinct subset of a given set.
#Source_code
#Data_structure
#Binary
#97
Find the minimum index of a repeating element in an array
#Source_code
#Data_structure
code.png
686.8 KB
Java program to find the maximum and minimum value node from a doubly linked list.
#Source_code
#Doubly_linked_list
#Data_structure
Find the missing term in a sequence in logarithmic time
Given the missing term in a sequence in logarithmic time
#Source_code
#Data_structure
#132
code.png
479.9 KB
When looking for a place to insert a new key, traverse the tree from root-to-leaf, making comparisons to keys stored in the tree’s nodes and deciding based on the comparison to continue searching in the left or right subtrees. In other words, we examine the root and recursively insert the new node to the left subtree if its key is less than that of the root or the right subtree if its key is greater than or equal to the root.
#Source_code
#Data_structure
#Recursion_Version
#135
code.png
679.7 KB
Activity Selection Problem

Activity Selection Problem: Given a set of activities, along with the starting and finishing time of each activity, find the maximum number of activities performed by a single person assuming that a person can only work on a single activity at a time.
#Source_code
#Data_Structure
#136
Given a set of positive integers S, partition set S into two subsets, S1 and S2, such that the difference between the sum of elements in S1 and S2 is minimized. The solution should return the minimum absolute difference between the sum of elements of two partitions.
#Source_code
#Minimum_Sum_Partition_problem
#Data_structure
#137