- Processing data is a fundamental operation in Computer Science
- Two fundamental operations in processing data are searching and sorting
- Form the basis or preprocessing step of many algorithms
- Large variety of algorithms have been developed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using UnityEngine; | |
using System.Collections; | |
using Valve.VR; | |
using Valve.VR.InteractionSystem; | |
public class BallController : MonoBehaviour | |
{ | |
//drag drop the Joystick child in the Inspector to animate | |
// the joystick when moved | |
public Transform Joystick; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package cse.unl; | |
import java.time.LocalDate; | |
import java.util.ArrayList; | |
import java.util.Arrays; | |
import java.util.Collections; | |
import java.util.Comparator; | |
import java.util.List; | |
public class Sorting { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <stdlib.h> | |
#include <stdio.h> | |
long fibonacci(int n) { | |
if(n == 0 || n == 1) { | |
return 1l; | |
} else { | |
return fibonacci(n-1) + fibonacci(n-2); | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package cse.unl; | |
import java.time.LocalDate; | |
public class Demo { | |
public static void main(String args[]) { | |
LocalDate dateOfBirth = LocalDate.of(1990, 7, 9); | |
Student s1 = new Student(35140602, "Chris", "Bourke", 4.0, dateOfBirth); |
- A file is a unit of stored memory, usually on disk
- A file can also be... directories, buffers (standard input/output are files), a socket could be a file, a program is a file
- You can write to and read from a file
- Files may be plaintext or binary (or plaintext but not intended for human consumption: EDI, XML, JSON, base-64 encoding)
- The basic steps to follow are:
- Open the file
- Process the file
- A file is a unit of stored memory, usually on disk
- A file can also be: directories, buffers (standard input/output are files), a socket could be a file, a program is a file
- You can write to and read from a file
- Files may be plaintext or binary (or plaintext but not intended for human consumption: EDI, XML, JSON, base-64 encoding)
- The basic steps to follow are:
- Open the file
- Process the file
- Strings represent data that may need to be processed
- Common to deal with CSV (Comma separated value) or similar formatted data
- Standard library functions can help, but processing involves designing algorithms
- There is a
ctype.h
library that provides several "check" functions for single characters:isalpha(c), isdigit(c), islower(c), isupper(c), isspace(c)
, conversion:toupper(c)
,tolower(c)
, etc.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include<stdlib.h> | |
#include<stdio.h> | |
#include "array_utils.h" | |
int main(int argc, char **argv) { | |
int n = 5; | |
int a[] = {1, 6, 7, 2, 3}; | |
int b[] = {9, 4, 2, 5, 2}; |
NewerOlder