Skip to content
sneppets

sneppets

  • Privacy
Stack Example

Stack Example 1: Reverse a string or word

November 13, 2018December 8, 2018 Editorial StaffLeave a Comment on Stack Example 1: Reverse a string or word

In our previous article Stack Introduction and Implementation we had learnt how to implement stack in java. In this first example we will see how to reverse a word or a string using a stack. When you run the following code, it… Read More!

DS, Java reverse string, stack, stack example
Stack Java

Stack Introduction and Implementation in Java

November 13, 2018December 8, 2018 Editorial StaffLeave a Comment on Stack Introduction and Implementation in Java

Stack is more abstract entity than array and many other data structures. The underlying mechanism used to implement stacks is not visible to the user. It follows Last In First Out (LIFO) principle i.e., stacks allows access to only one… Read More!

DS, Java stack, stack class
Arrays.sort() NullPointerException

Arrays.sort(), compareTo NullPointerException

November 13, 2018August 6, 2024 Editorial Staff

Are you getting NullPointerException while using Arrays.sort() and Comparable and don’t know exactly where is the problem in your code ? Solution You may get this exception when you miss any element or something is null. Check the following example,… Read More!

Java arrays sort, comparable, compareTo, NullPointerException
google vpn example

GCP Virtual Private Network (VPN) Tunnels Lab Example

November 10, 2018December 8, 2018 Editorial StaffLeave a Comment on GCP Virtual Private Network (VPN) Tunnels Lab Example

In this lab you create two networks in separate regions and establish VPN tunnels between them such that a VM in one network can ping a VM in the other network over its internal IP. GCP VPN Lab Excercise 1.… Read More!

cloud, google GCP VPN, GCP VPN tunnel, Google VPN, VPN tunnel
sort objects

Sort objects in Java using Insertion Sort

November 1, 2018December 8, 2018 Editorial StaffLeave a Comment on Sort objects in Java using Insertion Sort

In our Java program below we use insertion sort to sort Student objects based on the lastName key values. The doInsertionSort() method in this example is similar to doInsertionSort() method in the insertion sort example, but the only difference is we… Read More!

Algo, Java comparable, comparator, insertion sort, sort objects

Posts navigation

Older posts
Newer posts
Copyright © 2018 Sneppets. All Rights Reserved