Initializing a boolean array of length 256 to track characters in the string. Note: We are considering all of 256 ASCII characters (standard ASCII characters(0-127) and Extended ASCII characters(128-255)) hence the length of array is 256 Checking if the length of string is more that 256. We only have 256 unique ASCII characters so if... Continue Reading →
Primitive Data Types in Java
Data types define and restrict the type of values that can be stored in the variables. Java has the following 8 primitive data types: Int - The Int or the Integer data type is a 32-bit signed two's complement integer. Int data type can only hold whole numbers ranging from -2,147,483,648 to 2,147,483,647. Default value for an... Continue Reading →
Linked List: JAVA
What is a LinkedList? Linked List (LL) is a data structure where each element links to the next element Element in Linked List are not indexed so to access an element you have to start from the head and work your way through to the required element LL is quite slow for retrieving data (Point 2) but... Continue Reading →
Reverse a String in JAVA
Create a function reverseString which takes a String as a parameter and prints out the string in reverse order Initialize a variable named reverse to hold the reversed String inside the reverseString1 method Create a for loop starting from the last index of the string passed to the method to 0. Last index is (length of the... Continue Reading →
Running a JAVA program from Terminal on Mac
Run Terminal on Mac by pressing command+spacebar and typing in Terminal in the search bar On terminal change directory to where you saved your java file (file with .java extension) by using the “cd” command on terminal You can list the content of a folder using “ls” command Compile java file using the following command user$... Continue Reading →
Running a python program from Terminal on Mac
Run Terminal on Mac by pressing command+spacebar and typing in Terminal in the search bar On terminal change directory to where you saved your python file (file with .py extension) by using the "cd" command on terminal You can list the content of a folder using "ls" command Next using the command python followed by... Continue Reading →
How to create a side menu using Swift: The easy way
A lot of apps these days have some kind of side menu which slide out when you select a little hamburger button on the navigation bar. In this blog I will be going over a simple method to create a side menu. Our slide out menu will look like this: Create a new project in Xcode.... Continue Reading →