ALGORITHM An Algorithm is a finite set of instruction that perform a particular task. An Algorithm should satisfy following criteria. Input: Zero or more quantities are supplied externally. Output: At least one quantity is produced. Definiteness: Each instruction is clear and unambiguous. Finiteness: Algorithm must terminate after few steps. Effectiveness: Every instruction must be very basic. ANALYSIS: It means determining amount of resources (such as time and space) needed to execute it. TIME COMPLEXITY: Time complexity of an algorithm is basically the execution time of a program. Time complexity of an algorithm depends on the number of machine instruction. SPACE…
-
-
Linear data structure: A data structure is said to be linear if its data item form a linear sequence. Examples of the linear data structure are: (a) Array (b) Linked List (c) Stack (d) Queue Array: An array is a collection of data elements of same datatype. The elements of the array are stored in consecutive memory locations. Arrays are declared using the following syntax: type name[size]; memory representation: Stack: A stack is a linear list in which insertion and deletion operations are performed at only one end of the list. It follows LIFO structure. Queue: A queue is a…
-
String is a sequence of characters. In this guide, we will see how to declare, use and manipulate strings in Kotlin. Declare a String in Kotlin There are whole bunch of ways we can define a String in Kotlin. Lets have a look at the following example, here we have declare two immutable strings website & longString and we have also declared two mutable strings name & lName. package tejprogramming fun main(args : Array<String>){ /** * These Strings are Immutable which * means they are read-only and * unchangeable */ val website = "Tej Sumeru" /** * This is how we declare long strings */ val longString…
-
There are two types of variables – mutable and immutable. An immutable variable is one whose value cannot be changed, also known as unchangeable or read-only variable. On the other hand the value of the mutable variable can be changed. Immutable variable: val keyword Immutable variable is declared using val keyword in Kotlin. In this example, we have declared an immutable variable myName using val keyword and later displayed the value of it. package tejprogramming fun main(args : Array<String>){ /** * This is an immutable variable * also called unchangeable variable * or read-only variable. */ val myName = "Suvidha" println("My Name is: "+myName) } …
-
Data structures: A data structure is a way of organizing data items such that data items can be accessed efficiently. Or A data structure is a way of organizing data items that considers not only the items stored, but also their relationship to each other. Types of data Structure: Primitive data structure: The data structures that are directly operated by machine level instructions are known as primitive data structures. Following are the primitive data structure: (a) Integer : – Integer is a represent numbers. – The set of integer is: {…………-(n+1), -n,…,-2,-1,0,1,2,……..,n,n+1,………} (b) Real: – The number having decimal point…
-
[vc_row][vc_column][vc_column_text]There are certain words in Kotlin that have special meaning and cannot be used as identifiers(variable name, function name, class name etc). These words are called reserved words or keywords. In this guide, we will learn about keywords and identifiers.[/vc_column_text][vc_custom_heading text=”Types of Keywords in Kotlin “][vc_column_text]We have two types of keywords: 1. Hard Keywords 2. Soft Keywords[/vc_column_text][vc_custom_heading text=”1. Hard Keywords”][vc_column_text]These keywords cannot be used as identifiers. For example This is valid: //valid variable name val myvar = 5 This is invalid: //error: "else" cannot be used as a variable name val else = 5 Kotlin Hard keywords Table as class break…
-
[vc_row][vc_column][vc_column_text]Kotlin is a statically-typed programming language, developed by JetBrains. If you have basic knowledge of Java, you will be able to learn Kotlin in no time. This Kotlin tutorial is designed for beginners so you would be able to understand Kotlin programming even if you have no knowledge of Java. Kotlin and Java are interoperable which means you can use them together in a Project as well as you can re-write a Java code in Kotlin efficiently. The syntax of Kotlin is concise than Java. In this tutorial you will learn why use Kotlin, what are the advantages of it and several guides…
-
[vc_row][vc_column][vc_custom_heading text=”PHP Syntax”][vc_column_text]The PHP parsing engine needs a way to differentiate PHP code from other elements in the page. The mechanism for doing so is known as ‘escaping to PHP’. There are four ways to do this −[/vc_column_text][vc_custom_heading text=”Canonical PHP tags”][vc_column_text]The most universally effective PHP tag style is − <?php ... ?> If you use this style, you can be positive that your tags will always be correctly interpreted.[/vc_column_text][vc_custom_heading text=”Short-open (SGML-style) tags”][vc_column_text]Short or short-open tags look like this − <? ... ?> [/vc_column_text][vc_column_text]Short tags are, as one might expect, the shortest option You must do one of two things to…
-
[vc_row][vc_column][vc_column_text]In order to develop and run PHP Web pages three vital components need to be installed on your computer system.[/vc_column_text][/vc_column][/vc_row][vc_row][vc_column][ul] Web Server − PHP will work with virtually all Web Server software, including Microsoft’s Internet Information Server (IIS) but then most often used is freely available Apache Server. Database − PHP will work with virtually all database software, including Oracle and Sybase but most commonly used is freely available MySQL database. PHP Parser − In order to process PHP script instructions a parser must be installed to generate HTML output that can be sent to the Web Browser. This tutorial will guide you…
-
[vc_row][vc_column][vc_column_text]The PHP Hypertext Preprocessor (PHP) is a programming language that allows web developers to create dynamic content that interacts with databases. PHP is basically used for developing web based software applications. This tutorial helps you to build your base with PHP.[/vc_column_text][vc_custom_heading text=”Why to Learn PHP?”][/vc_column][/vc_row][vc_row][vc_column][vc_column_text]PHP started out as a small open source project that evolved as more and more people found out how useful it was. Rasmus Lerdorf unleashed the first version of PHP way back in 1994. PHP is a MUST for students and working professionals to become a great Software Engineer specially when they are working in Web Development Domain. I will…