Hurry Up! And Get Flat 10% Discount On Your First Order We are available by 24/7 for your support!
+91 82 67 81 38 69
Realcode4you Forum
Welcome to the Realcode4you Forum, get all assignment related help at here
Machine Learning Tutorial
Complete Machine Learning Tutorial with Examples
5Machine Learning
Get top Machine Learning coding and project help.
3ML Algorithms
Machine Learning Algorithms with regression and Classification with full description
15Python Tutorial
Are you ready to learn python with us, let's started at here
3Python
Are you looking Python Project Help, here you can get different types of python project help
2Java
Get any type of Java Project at here, or are you learn it with us?
17Python Programming
Collection of python top researched paper examples to learn python programming.
4Database
Get Help In MySQL, MongoDB, SQL Server, Postgre SQL, Oracle, MS Access, etc.
14C/C++
Are You Looking C/C++ Assignment Help Or Need To Learn Then You Can Discuss With At Here
3PHP
Get And Learn PHP Project Assignment Or Homework Help With An Real-Life Example
0SQL
Welcome! Here you can learn complete SQL with specific examples.
4Mobile App Development
Hire expert to get help in Android Studio Projects, React Native Projects and other Mobile Development Related Help.
12D3.js
Hire expert to get help in JavaScript and it's web development libraries like D3.js, React.js and Process.js
5Software Engineering
Hire expert to get help in Software engineering, Application Analysis and Design related topics.
9R Programming
At Realcode4you you will get all R programming assignment, homework and project help.
2
- C/C++1. Write a non-recursive implementation of inorder, preorder, postorder traversal. 2. Write a C program that takes inorder and preorder traversal as input, output the tree. You need to print the nodes of the tree level by level. Your code should output an error message if the inorder and preorder are not corresponding to the same tree. 3. Write a C program that takes inorder and postorder traversal as input, output the tree. You need to print the nodes of the tree level by level. Your code should output an error message if the inorder and preorder are not corresponding to the same tree. 4. Write a C program that takes preorder and postorder traversal as input, output the tree. It is given that each node consists of exactly two children. Your code should output an error message if the inorder and preorder are not corresponding to the same tree. You need to print the nodes of the tree level by level. 5. Write a C program that takes an arithmetic tree as input and outputs the result of the arithmetic expression. The leaf node is numeric data in an arithmetic expression tree, and the non-leaf/internal node is the operator. 6. Write a C program that prints the given tree vertically. The following example explains the vertical tree traversal.Like
- R ProgrammingLastly I’d like to cover a very imprtant topic in data prep that is to handle date time data . Why the special attention? Because the way date time data is recorded is essentially as a character and when it is dealt with, its like numbers . Now parsing these seemingly character strings to numbers in a way that they can represent data time and then throw those time zones in the mix and you have pretty difficult situation to handle. Fret not , we have package lubridate to make our life pretty easy. Please install package lubridate before you begin running these codes. Note: All our examples are based on converting character strings to dates using functions. When you are reading data from a file, read a date time column as character and convert it to a date time object type later. Its always easier to do. We’ll start with converting various dates in different formats stored as characters. These formats can be different in terms of with in that data in what order day, month and year appear. Identify the order in which the year, month, and day appears in your dates. Now arrange “y”, “m”, and “d” in the same order. This is the name of the function in lubridate that will parse your dates. For example, library(lubridate) ymd("20110604") ## [1] "2011-06-04" mdy("06-04-2011") ## [1] "2011-06-04" dmy("04/06/2011") ## [1] "2011-06-04" you include time components and timezones as well by simply adding the order of time components hours (“h”), minutes (“m”) and seconds (“s”). Appropriate function name exists. arrive = ymd_hms("2011-06-04 12:00:00", tz = "Pacific/Auckland") leave = ymd_hms("2011-08-10 14:00:00", tz = "Pacific/Auckland") you can extract and set individual elements of the date as well. second(arrive) So far we have seen seemingly well formatted character strings as input for dates which is not always the case . Dates can have months as character names or even abreviated form of three letter words. And same goes for other date components as well. You can handle that by specifying your own formats too these format builders and function parse_date_time. • b : Abbreviated month name • B : Full month name • d : Day of the month as decimal number (01 to 31 or 0 to 31) • H : Hours as decimal number (00 to 24 or 0 to 24). 24 hrs format • I : Hours as decimal number (01 to 12 or 0 to 12). 12 hrs format • j : Day of year as decimal number (001 to 366 or 1 to 366). • m : Month as decimal number (01 to 12 or 1 to 12). • M : Minute as decimal number (00 to 59 or 0 to 59). • p : AM/PM indicator in the locale. Used in conjunction with I and not with H. • S : Second as decimal number (00 to 61 or 0 to 61), allowing for up to two leap-seconds (but POSIXcompliant implementations will ignore leap seconds). • OS :Fractional second. • y : Year without century (00 to 99 or 0 to 99). • Y : Year with century. Although there are too many format builders here , you’ll generally use few. we’ll see example with those. you can handle hetrogenous formats as well. parse_date_time("01-12-Jan","%d-%y-%b") ## [1] "2012-01-01 UTC" parse_date_time("01-12-Jan 12:05 PM","%d-%y-%b %I:%M %p") ## [1] "2012-01-01 12:05:00 UTC"
- R ProgrammingReading Data to R Reading data in R is fairly simple. We’ll be looking at function read.csv which helps you in reading data from the flat file formats. Flat files are files which you can open in a simple notepad and view the data. Excel files or any other proprietry data file format is NOT a flat file and can not be read using read.csv. Each properietry data file format has dedicated packages and associated functions for them . For example Excel files can be read using function read.xlsx found in the packaga xlsx Function read.csv comes with a lot options which you can see in the documentation. You dont need to pass values to all those options most of the time and set defaults work alright. However we are going to discuss few of them which you might use from time to time. file : this is the name of the file to be read. In case file is in your working directory , only the file name is enough. If it is not in your working directory, you need to include entire path to the folder where file is along with the file name. header : This is by default set to FALSE, if you set it to true, variable names are read and assigned from the first row of the file sep : This is set to , by default. This tells R what symbol separates different columns in a row. For example a semi colon separated file has “;” as separator row.names : You can pass a vector of row names if you want to set row names for your data. you generaly leave it as is col.names : In case you want to force some other variable names you can pass those names as a vector to this option. Length of this vector or number of names that you are passing should match with number of columns. They are taken from first row of the file if header is not set to FALSE. You can set header to FALSE and R gives default col headers as V1 V2 V3.... stringsAsFactors : This is be default set to TRUE, you should always set this to FALSE while reading a flat file. What setting this to FALSE does that it imports character columns as character columns. You can later convert them to factors if you want; after pre processing the data. na.strings : This is by default set to “NA”. This means that any value which is written as “NA” will be assigned a missing/NA after reading. You can change this to other strings as well. colClasses : By default this is set to NA or no forced classes. However you can pass a vector to force classes on the incoming columns. Without forcing , a column which contains only numbers or NA strings will be read as numeric. Column which contains even a single character value will be read as character [ given that you have set stringsAsFactors to FALSE , otherwise it’ll be stored as factors] nrows : By default it is set to -1 which means all the rows from the file will be read. You can restrict that by passing a number smaller than the number of rows in file. skip : By default this is set to 0, by assigning some number you can force R to skip first few rows of the file. We will skip discussion on rest of the rarely used options. Lets look at one example. We’ll be using function read.csv. Remember if you are going to pass just file name you need to set your working directory to the folder which contains the file. You can do this by using function setwd. This is short for setting working directory. setwd(" Here/Goes/Path/To/Your/Data/Folder/") Also note that if you are working on a windows machine, you’d need to replace all “" in your path with”/" or “\” you can check what is your current working directory by typing in getwd() getwd() We are going to import data file bank-full.csv here. Lets begin, we’ll start with passing just the file name and let all other be option take their defaults. We’ll change some as we come across issue with the imported data. bd=read.csv("bank-full.csv") head(bd,2) you can see that we have been fooled by the file extension and assumed that the separator for the data is comma where as in reality it is “;”. Lets tell that to R by using option sep. bd=read.csv("bank-full.csv",sep=";") head(bd,2) ok, this looks better. Now lets look at our data. library(dplyr) ## Warning: package 'dplyr' was built under R version 3.3.2 glimpse(bd) you can see that all of our character columns have been stored as factors. This needs to be avoided. And we can do so by using option stringsAsFactors. Best of us make mistake by misspelling that option. Dont get frustrated. It’ll become a parctice to make mistake, realise and correct. bd=read.csv("bank-full.csv",sep=";",stringsAsFactors = FALSE) glimpse(bd) So thats taken care of , big relief. Next lets look at what values our variable job takes. table(bd$job) you can see that there are 288 observations where the value is unknown , if you want you can set it to missing by using option na.strings. But remember this will set the value unknown as missing for all the columns. If you want to do it only for one of columns then do that after you have imported the data. ## [1] 288 bd=read.csv("bank-full.csv",sep=";",stringsAsFactors = FALSE,na.strings = "unknown") sum(is.na(bd$job)) You can see that , now column job has 288 missing values. This was to show you how to use option na.string. In general it is not a good practice to set any random value as missing . So , for practice its alright, but dont set unknown to missing in general unless you have good reason to do so. In fact in many of the cases of categorical variables , unknown itself can be taken as a valid category as you’ll realise later. We dont need to change default values of other options for this importing. Same will be the case for you as well for most of the data. If it is not , feel free to use any of the option described above.